Hey there,
I just found this very usefull shell script here on SO but unfortunately it's not working on Mac OS X 10.5.
This is the script in question(copied it for convenience):
#!/bin/bash
LIMIT=$1
P=$PWD
for ((i=1; i <= LIMIT; i++))
do
P=$P/..
done
cd $P
I tried to echo $P
at the very end and it's returning the right path, but still cd $P
doesn't seem to be working.
So I tried to manually enter P="some/path"
and cd $P
in the terminal and it worked.
I don't get why the same command isn't working in the script. Could it be a security thing?
Any suggestions?