The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 02-12-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,641
The "$2" will be resolved, because variables are expanded prior to the execution of a command (see "command evaluation in the Korn shell" - to change the default behaviour is what "eval" is for, yes?) .

The problem is that the "$2" is inside single quotes, which will prevent evaluation of the variable:


Code:
# var="hello there"
# print $var
hello there
# print "$var"
hello there
# print '$var'
$var

Making the variable $2 expand is a bit cumbersome, it goes like that:


Code:
var="there"
# print 'hello '"$var"'.'
hello there.

Quote:
vbe said:
(thats 6 years now I havent touched dsh, was a time when I was responsible of a SP2...)
ahh, the good old days of PSSP 2.1 and 2.2 - before IBM came up with that "perspectives"-crap......

I hope this helps.

bakunin