This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Not able to unserstand the difference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Not able to unserstand the difference" Watch "Not able to unserstand the difference" New topic
Author

Not able to unserstand the difference

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Guys,

I'm not able to interpret the following shell command...



How does "\$USER=$USER" the same as given in line 2?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
Well the following things you should know about bash:
- ' is different than ", the first specify a string which is not interpreted
- $ specify an environment variable, if is in 'string' is not interpreted, if is in "string" it is
- \$ is an escape sequence, so, even is present "string", the \$ is interpreted as a string, not as a value of a variable

Hope it helps


http://javasign.blogspot.com/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Not able to unserstand the difference
 
Similar Threads
shell script to get the end of line
create and execute a batch file through a java program
Creating Platform independent scripts(Solaris and Linux)
Writing a file and executing
SED Question (String tokenize)