Operating System - HP-UX
1753448 Members
6109 Online
108794 Solutions
New Discussion юеВ

Re: whilst scripting is = same as ==?

 
SOLVED
Go to solution
SM_3
Super Advisor

whilst scripting is = same as ==?

Hello

I saw == in a script is it the same as =?

Thanks
4 REPLIES 4
KapilRaj
Honored Contributor
Solution

Re: whilst scripting is = same as ==?

== is used in awk scripts and = in shell scripts. Yes they hv the same meaning.

Kaps
Nothing is impossible
Bruno Ganino
Honored Contributor

Re: whilst scripting is = same as ==?

YES
Bruno
Torino (Turin) +2H
H.Merijn Brand (procura
Honored Contributor

Re: whilst scripting is = same as ==?

in perl they don't :)

== means the TEST if the left expression is equal to the right expression
= means the ASSIGNMENT of the outcome of the expression on the right to the variable on the left

HTH. Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
curt larson_1
Honored Contributor

Re: whilst scripting is = same as ==?

all modern programing languages use
== to test for equality and
= for variable assignment.

awk,perl,tcl,c,c++,etc all do this

hp's shell hasn't implemented many of the standard features available with modern programing languages, i.e. floating point numbers, assocative arrays, using pointers to pass values to functions, etc.

hp's shell hasn't implemented ==. with hp's shell = is used both for variable assignment and for testing equality