in reply to Re: Re: how to get the current folder name where the program is running?
in thread how to get the current folder name where the program is running?
So you tested this right?
[root@smart sporty]# pwd /root/sporty [root@smart sporty]# cat uhuh.pl #!/usr/bin/perl print "$0 does not know\n", `pwd`; [root@smart sporty]# ./uhuh.pl ./uhuh.pl does not know /root/sporty [root@smart sporty]# perl uhuh.pl uhuh.pl does not know /root/sporty [root@smart sporty]#
If you aren't in that directory where it was run, cwd fails miserably.
And if (you) don't call the script with /full/path/to/script.pl then $0 has little to offer....
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: how to get the current folder name where the program is running?
by exussum0 (Vicar) on Dec 13, 2003 at 16:41 UTC |