in reply to Curious Symlink question
Your post is a bit difficult to follow, but $0 will return the name of the code as invoked. To illustrate:
$ echo "#!/usr/bin/perl\nprint $0;" > tmp
$ ln -s tmp temp
$ ./temp
./temp
UPDATE: Beware potential shell interpolation of $0. The ./tmp file should contain the follow two lines:
#!/usr/bin/perl -w print $0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Curious Symlink question
by patrickrock (Beadle) on May 03, 2005 at 16:06 UTC |