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
    yes! brilliant. the $0 var worked just as you guys described.

    Sorry my question was confusing. Even apparently to myself.

    Thanks for your help, and if you want here is the longer story.

    Oracle applications 10.7 provides a way to feed arguments from oracle apps to a shell script.

    It works like this

    1. Make your shell script with a .prog extenstion. so test.prog

    2. make a symlink to a special oracle binary like so using the name of your .prog so:
    ln -s fnddescr test

    then define test in oracle.

    you call test from oracle, give it your arguments, and then oracle calls test which calls fnddescr which parses the oracle payload, and hands the arguments back to test.prog.

    we wanted to know if how fnddescr could know what called it.

    presumably they have something similiar to $0 again thanks for your help!