Results 1 to 5 of 5
Originally Posted by Gekitsuu
you should be able to do NEWSTRING=$STRING1$STRING2
it works but i can't use it for creating a path variable / file name.
e.g.
$STRING1 = path
...
- 03-15-2010 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 3
- 03-15-2010 #2
Are you bash scripting?
You dont use the "$" in front of the variable name when you assign it, only when you use it - the following script will print the contents of /etc/resolv.conf:
#!/bin/bash
STRING1="/etc/"
STRING2="resolv.conf"
cat $STRING1$STRING2
- 03-15-2010 #3There shouldn't be any space before and after equal to = sign.
Originally Posted by sachinpandhare It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 03-15-2010 #4
Should have categorically stated that in my post / code correction too (even though I did fix that point too) - cheers casper, I just assumed it was a typo - although you didnt mention the other fundamental bug I noted above, i.e. the inclusion of the $ when declaring vars
- 03-16-2010 #5I checked this thread after you and didn't want to repeat your suggestion.
Originally Posted by DT0X
I just added one more point in your suggestion.
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First



Reply With Quote