PDA

View Full Version : [SOLVED] [bash] Problem with $PWD



TreeFinger
June 24th, 2008, 06:16 PM
I have a very simple script that is going to assign the current working dir to a variable.

I have tried everything..

MYDIR=$PWD
MYDIR=`pwd`
MYDIR=$(pwd)


nothing works.. why? I'm copying this out of a book for god's sake.

Alasdair
June 24th, 2008, 06:24 PM
Works for me.

> MYDIR=$PWD
> echo $MYDIR
/home/alasdair