LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-05-2009, 09:32 PM   #1
caponewgp
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Rep: Reputation: 0
Different Operators


I was wondering if anyone could help me with the differences between "$PWD" '$PWD' `$PWD`. Basically I just don't understand exactly how '' "" `` change the output of the command. Thanks again
 
Old 09-05-2009, 09:54 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Quote:
# Prints the contents of shell variable "PWD" (the current directory)
echo $PWD
/tmp
Quote:
# Equivalent: the double quotes simply make sure that, if there were multiple "words" (like "aaa" "bbb" and "ccc"), they would all be part of the same, single string:
echo "$PWD"
/tmp
Quote:
# The single quotes PREVENT the shell from "expanding" $PWD:
echo '$PWD'
$PWD
Quote:
# The back-quotes expand "$PWD" first, then try to use it as an argument:
# BAD EXAMPLE:
echo `$PWD`
bash: /tmp: is a directory
'Hope that helps .. PSM

Last edited by paulsm4; 09-05-2009 at 10:54 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference in operators hackop Programming 3 05-07-2009 07:18 AM
C++ templated operators rjlee Programming 5 08-04-2007 06:17 AM
Operators *^ and >> GodSendDeath Programming 4 11-01-2004 10:47 PM
Bitwise operators kamransoomro84 Programming 8 04-22-2004 11:46 PM
operators linuxanswer Programming 3 12-14-2003 07:09 PM


All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration