On Jul 21, 2013, at 1:57 PM, John Musbach <[email protected]> wrote:

> 
> 
> On Sun, Jul 21, 2013 at 4:54 PM, Michael <[email protected]> wrote:
> 
>> Use the command "pwd".
> 
> Nope. That tells me where the user is, not where the shell script is.
> 
> Are you sure? If you do say,
> 
> SCRIPT_DIR=`pwd`
> echo "$SCRIPT_DIR"
> 
> the echo should return the directory the script ran in. 


Note that my original response distinguished between the directory the script 
is run from and the directory containing the script:

#!/bin/bash
current_dir=$(pwd)
script_dir=$(dirname $0)

echo $current_dir
echo $script_dir

./s


--
>>> Birdhouse Hosting <<<
Custom web and mail hosting services
http://hosting.birdhouse.org

d(-_-)b





_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to