How to echo the parth ? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

How to echo the parth ?

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-09-2004
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
 
Join Date: Aug 2004
Last Activity: 1 November 2006, 5:31 PM EST
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Hammer & Screwdriver How to echo the parth ?

Hi,
I would like to be able to echo my current path by using
echo $pwd. but it's not working.
Can someone tell me what's wrong with it?

ThanX!
Sponsored Links
    #2  
Old 09-09-2004
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 28 August 2014, 5:04 PM EDT
Location: NM
Posts: 10,180
Thanks: 275
Thanked 785 Times in 734 Posts
pwd

just like that gives you the current working directory

echo $PATH

gives you the PATH variable - a list of directories in your PATH
Sponsored Links
    #3  
Old 09-09-2004
google's Avatar
google google is offline Forum Advisor  
Advisor
 
Join Date: Jul 2002
Last Activity: 17 June 2009, 5:17 PM EDT
Location: Atlanta
Posts: 740
Thanks: 0
Thanked 2 Times in 2 Posts
You can also overide the current value of PS1 (this sets your primary prompt). Assuming Korn Shell:

export PS1='$PWD--> '

will produce a command prompt like the following (and will be updated with your present working directory as you navigate your system):

/usr/bin-->
    #4  
Old 09-13-2004
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
 
Join Date: Sep 2004
Last Activity: 26 July 2012, 3:38 PM EDT
Location: USA
Posts: 512
Thanks: 0
Thanked 2 Times in 2 Posts
give the commnad like this :

echo `pwd`
Sponsored Links
    #5  
Old 09-14-2004
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
 
Join Date: Aug 2004
Last Activity: 1 November 2006, 5:31 PM EST
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL echo `pwd`

Thank you bhargav!
This is the command I was looking for.
but how come mine doesn't work?

Is there any rules to follow for this kind of command to work?
Especially what does ` ` mean here? How to use it?
Sponsored Links
    #6  
Old 09-14-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
You don't even need to use echo, what's the point?

Just a simple pwd at the command line will do.

Cheers
ZB
Sponsored Links
    #7  
Old 09-14-2004
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
 
Join Date: Aug 2004
Last Activity: 1 November 2006, 5:31 PM EST
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb pwd

You are right.
I am learning to write shell script.
I did see some people write echo `pwd` in the script.
If it's the same as pwd, why people write echo `pwd`in the script?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
echo ** jianma Shell Programming and Scripting 2 06-28-2011 09:53 PM
With that logic this echoes "echo". Question about echo! hakermania Shell Programming and Scripting 2 11-11-2010 05:13 PM
How to correctly use an echo inside an echo? mokachoka UNIX for Dummies Questions & Answers 3 09-19-2009 11:40 PM
Difference between using "echo" builtin and /bin/echo ulidtko Shell Programming and Scripting 2 07-15-2009 11:12 AM
How To echo them....? jojo123 Shell Programming and Scripting 5 06-12-2009 12:37 PM



All times are GMT -4. The time now is 10:16 PM.