Crontab help

hi,

I run a .sh file using crontab. I need to know the path of the file . Previously when I run the file alone , i used "pwd" but now when using crontab it gives the temp directory of the file.
Is there any way I can find the absolute path of the file when i execute it ?

Regards,
Ranga

"which <file>" would give you the absolute path. Is that what you need ?

current_dir=`cd \`/usr/bin/basename $0\` && pwd`

Hi
i tried the command
current_dir=`cd \`/usr/bin/basename $0\` && pwd`
I am getting the following. Can you please help me.

It is throwing a err: �/ss.sh: cd: ss.sh: Not a directory�

Regards,
Ranga

hi,

Which <file> is giving me �./<file>� as o/p

Regards,
Ranga

Sorry, I must ahave been asleep when I posted that...

current_dir=`cd \`/usr/bin/dirname $0\` && pwd`

hi,

Thanks for your prompt response. Will this work in csh and bash shells ?

I am executing the script in csh.

Regards,
Ranga

Will this command `cd \`/usr/bin/dirname $0\` && pwd` change the directory or jus find the directory!!!

Regards,
Ranga