[ale] Shell: dir name

Zyman, Andy zymana at hra.nyc.gov
Tue May 21 09:32:53 EDT 2002


Hello,
i have simple question. but i somehow stuck on it.

I need to find out from which dir. the scripts was executed.
here is an example:
cat /tmp/staff/script.sh
#!/bin/ksh
SPOOL_FILE=$PWD/log/spool_file.log
echo $SPOOL_FILE
#END

After "manual" executing , the output is:
/tmp/staff/log/spool_file.log

this was working perfectly well until i cronned it.

now in the output i basically have :
$HOME/log/spool_file.log

I thought there is an env. var which will point to the dir. The only one
thing i found is $_. But it returns ( in case of ksh ) the whole
path/script_name. And i just need  dir. Any help?
 
Thank You
 Andy
office: 212 849 3543

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list