LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 08: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, 08: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 09:54 PM.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:51 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
Open Source Consulting | Domain Registration