in reply to Re: Finding out how you were called...
in thread Finding out how you were called...

I assume that $0 is set by the shell, not by the OS... I have RH 7.1 with bash and I get exactly what was typed to run the command... i.e. foo ./foo /usr/bin/foo etc...

                - Ant
                - Some of my best work - Fish Dinner

  • Comment on Re: Re: Finding out how you were called...

Replies are listed 'Best First'.
Re: Re: Re: Finding out how you were called...
by rchiav (Deacon) on Aug 07, 2001 at 00:57 UTC
    wierd.. I have RH 7.1 with bash (perl 5.61). Here's my test
    #!/usr/bin/perl -w print " I was called as $0\n";
    results as follows. tt is the original file. rr is a symlink in /usr/local/bin
    [xxxx@yyy:/home/xxxx]$ tt I was called as ./tt [xxxx@yyy:/home/xxxx]$ rr I was called as /usr/local/bin/rr [xxxx@yyy:/home/xxxx]$
      My bad... I was assuming perl's $0 and c's argv[0] were the same, which they are not... $0 does have exactly what I want, thanks...

                      - Ant
                      - Some of my best work - Fish Dinner