Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ucsd!swrinde!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!helium.ecn.purdue.edu!patkar From: patkar@helium.ecn.purdue.edu (The Silent Dodo) Newsgroups: comp.unix.questions Subject: comp.unix.questions Keywords: shell script, directory Message-ID: <1990Sep7.152354.9439@ecn.purdue.edu> Date: 7 Sep 90 15:23:54 GMT Sender: news@ecn.purdue.edu (USENET news) Organization: Purdue University Engineering Computer Network Lines: 13 I have a question about shell scripts. How can a shell script (sh or csh) find out its own file name? Actually, I need to know only the directory in which it resides. My shell scripts need, say, some "sed" script files and it is always nice to keep them in the same directory as the shell script. So when I move the shell scripts to a different directory or a different machine I have to make changes in the pathname for the sed scripts. Is there a better way to do this? -- Anant (patkar@cn.ecn.purdue.edu)