Re: locating a sourced file



Neil Cherry <njc@xxxxxxxxxxx> wrote:
How can a sourced file determine its location?

Source files cannot determine anything - they are not executables.

I think the OP mean how can a sourced file (like in shell ./file.sh)
determine it's location. This sounds like home work so I won't answer
this directly but take a look at the variable $0.

If it is homework, it strikes me as being a rather advanced class :^)

Looking at $0 certainly won't help.

I doubt that there is a way, but maybe somebody here is smarter than I am.

Yours,
Laurenz Albe
.



Relevant Pages

  • Re: locating a sourced file
    ... Source files cannot determine anything - they are not executables. ... I think the OP mean how can a sourced file (like in shell ./file.sh) ... This sounds like home work so I won't answer ...
    (comp.os.linux.misc)
  • object names from executable image files
    ... I was able to use log files from the past 18 ... batch programs to come up with a list of retirement candidates. ... Many executables are composed of multiple object files (the ... did I mention that the source files are COBOL? ...
    (comp.os.vms)
  • Lahey Windows compilation problem
    ... the current working directory is on the C drive and source files are in ... I can compile and run programs. ... working directory is on a network drive, and sources are in the same ... I can create and run executables on the network drive with g95 without ...
    (comp.lang.fortran)
  • Re: Does VS.Net cache source files?
    ... the original source files were the ones that got corrupted. ... Only binaries if u use Windows 2003 where ShadowCopy makes copy of your executables. ... Michael Nemtsev:: blog: http://spaces.msn.com/laflour ...
    (microsoft.public.dotnet.general)
  • Re: make question relating foreach ?
    ... > I create makefiles automatically based on existing source files over a ... I just cobbled together a Makefile where I put files with into OBJS, ... possibility is that it's a problem with your shell, ... do it in a single command - just use your shells commands for doing ...
    (comp.unix.programmer)