This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to unserstand the difference

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

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



How does "\$USER=$USER" the same as given in line 2?
 
Aurelian Tutuianu
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic