Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

whilst scripting is = same as ==?

 
SOLVED
Go to solution
Highlighted
Super Advisor

whilst scripting is = same as ==?

Hello

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

Thanks
4 REPLIES 4
Highlighted
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
Highlighted
Honored Contributor

Re: whilst scripting is = same as ==?

YES
Bruno
Torino (Turin) +2H
Highlighted
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
Highlighted
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