• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to unserstand the difference

 
Joe Harry
Ranch Hand
Posts: 10109
3
Eclipse IDE Mac PPC Ubuntu
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic