in reply to Get My Own Name

given $0 is unreliable and inode theory is not portable, I have to ask (please forgive me) -- just what are you trying to do?

I understand the current problem, but what is the purpose of this script? It may be, for instance, that you can make better choices about what file is a potential target for processing (based on name or contents). You may be able to run this from another path.

This problem seems sort of odd, so I think that warrants an inquiry into the function of the script.

Replies are listed 'Best First'.
Re: Re: Get My Own Name
by peschkaj (Pilgrim) on Feb 05, 2004 at 03:02 UTC

    Because tar on HP-UX is broken, we have been forced to implement our own work around. Normally, on Solaris at least, you can supply tar with an exclude file. Thus allowing you to avoid tarring up mp3s or your collections of GTK+ themes and backgrounds or what have you.

    I wanted to include this functionality in the script because you never can tell when some one is going to pass the script along to a friend but not tell them how to use it properly. Nor did I want to have to hardcode the name of the script since file names can change.

      I trust you're going to use Archive::Tar?

      If you are going to substitute for a program where you would have used and exclude-file, why don't you just implement exclude-file functionality into your program? No need to know your program's name (just like tar wouldn't need to know its name).


      The PerlMonk tr/// Advocate
      HP-UX tar is broken? How about GNU tar? It has exclude options
      That's why God gave us cpio.

      Abigail