Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-05-2009, 08:32 PM   #1
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, 08:54 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

# Prints the contents of shell variable "PWD" (the current directory)
echo $PWD
# 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"
# The single quotes PREVENT the shell from "expanding" $PWD:
echo '$PWD'
# The back-quotes expand "$PWD" first, then try to use it as an argument:
echo `$PWD`
bash: /tmp: is a directory
'Hope that helps .. PSM

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


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 06:18 AM
C++ templated operators rjlee Programming 5 08-04-2007 05:17 AM
Operators *^ and >> GodSendDeath Programming 4 11-01-2004 09:47 PM
Bitwise operators kamransoomro84 Programming 8 04-22-2004 10:46 PM
operators linuxanswer Programming 3 12-14-2003 06:09 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:13 PM.

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