The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-26-2007
jaduks's Avatar
jaduks jaduks is offline
Registered User
 

Join Date: Aug 2007
Location: Assam,India
Posts: 154
Content of Content of a variable!

I got a sample BASH script like this :

$ cat test
MYVAR=$1
DUMMY1="This is tricky"
DUMMY2=24
echo $[$MYVAR]


$ ./test DUMMY1
./test: line 5: This is tricky: syntax error in expression (error token is "is tricky")
**I was expecting the output as "This is tricky", ah! but no luck


**But this works fine for intergers, no issues :-)
$ ./test DUMMY2
24

Could anyone guide me how to get the string in DUMMY1(i.e "This is tricky") through MYVAR? Please
Reply With Quote
Remove advertisements
!!
Forum Sponsor