On Wed, 15 Jan 2003, Mark Komarinski wrote: =>Without getting into the "why are you using X to do the job": => =>I've got a csh script in an arbitrary location. But I need to know =>from within the script where it exists in the directory structure. The =>reason for that is I need to source a file from within that same =>directory (where the script is). If I look for cwd or pwd, I get the =>directory my shell was when when I ran the script, not where the =>script itself is located. => =>As an additional condition, I can't use anything on the local system, as =>the script will be run over NFS to various systems (hence one of the =>reasons it's arbitrary). And it has to be csh, no tcshisms. => =>-Mark Where to start...
Never run any csh script. Go to google and read Tom Christionson's excellent paper "C shell considered harmful". Having been properly chastised, you can try refering to $0. It might work. Another reason for not using csh BTW is that the equivalent construct in bash or ksh uses PATH to locate file to source in, so there's no need to specify it via any kind of pathname. -- -Time flies like the wind. Fruit flies like a banana. Stranger things have - -happened but none stranger than this. Does your driver's license say Organ -Donor?Black holes are where God divided by zero. Listen to me! We are all- -individuals! What if this weren't a hypothetical question? [EMAIL PROTECTED] _______________________________________________ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss