Summary: Script Location

From: <PETESADL_at_aol.com>
Date: Wed, 01 Mar 2000 16:48:12 -0500 (EST)

Thanks to:
  tpb_at_doctor.zk3.dec.com (Dr. Tom Blinn)
  r.westlake_at_mail.cryst.bbk.ac.uk (Richard Westlake)
  lucio_at_ifctr.mi.cnr.it (Lucio Chiappetti)
  pas_at_unh.edu (Paul A Sand)
  Jeff.Cole_at_tfn.com (Cole, Jeff)
  jeff_at_popmail.med.nyu.edu (Jeff Berliner)
  in-house Sys Admin (Bill Heffernan)

Original question
   A script has been started (sh ./script_a) by a user and is running...,
   how would I (another user) find out from what directory was the script
   started?

To clarify
   I run the ps command with the -u and the original user and all I see
   under the command field is "sh ./script_a".
   I am looking for a way for Unix to tell me the directory of a
   command/process that was started without the directory reference.

Conclusion
   Unfortunately, all the "ps" output is going to show you is the command
   arguments, that is, $0 through $n, and if they don't include a real
   path (and in the case of a shell script invoked via "exec", they don't
   seem to do so), it isn't going to show up that way.

Indirect Solution (provided in-house)
   We were able to use the find command to locate all the locations that
   the command existed and then do an fuser command against the located
   files. That gave us PIDs that we then related back to the command/process
   and indirectly identified the file locations.
Received on Wed Mar 01 2000 - 21:50:07 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT