D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] remember current directory, change, cahnge back



On 12.12.2002 23:06 Mike wrote:
On 12.12.2002 22:55 Adrian Midgley wrote:
I want a shell script to leave the shell in the current directory
after it
finishes, but in between I want it to cd to a directory, execute this
and
that there, then cd back.

How do I get and then return the initial working directory?

x=`cd` cd / cd $x

--
or

x=$PWD
cd /
cd $x

 --
'ooroo

Mike...(:)-)
---------------------------------------------------
Email: mike@xxxxxxxxxxxxx        o
You need only two tools.        o /////
A hammer and duct tape. If it    /@   `\  /) ~
doesn't move and it should use  >  (O)  X<  ~  Fish!!
the hammer. If it moves and      `\___/'  \) ~
shouldn't, use the tape.           \\\
---------------------------------------------------

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly