Path: utzoo!attcan!uunet!know!samsung!uakari.primate.wisc.edu!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.unix.questions Subject: Re: Can you access command line args from a source'd script? Keywords: source, . Message-ID: <11888@crdgw1.crd.ge.com> Date: 14 Sep 90 15:12:07 GMT References: <1990Aug24.191615.27944@usenet.ins.cwru.edu> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Distribution: na Lines: 27 In article <1990Aug24.191615.27944@usenet.ins.cwru.edu>, boysko@dsrgsun.CES.CWRU.Edu (Glenn Boysko) writes: |>Is it possible to get the filename of a sourced file (either Csh or Sh) while |>the file is being sourced? |> |>For example, can you have a sourced file echo its pathname? Something like: |> |> % source |> |> I am Try the following: Create file "stest" containing the following: set line=`history 1` echo "My name is " $line[3] echo "My first arg is " $line[4] %source stest arg1 My name is stest My first arg is arg1 % I'm sure you'll want to make it more robust, but that's the general idea. ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com