From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079341819270.tru64-unix-managers.marc@archive.invalid> From: PETESADL () aol ! com Date: Wed, 01 Mar 2000 21:48:12 +0000 To: tru64-unix-managers Subject: Summary: Script Location X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079341819270 Thanks to: tpb@doctor.zk3.dec.com (Dr. Tom Blinn) r.westlake@mail.cryst.bbk.ac.uk (Richard Westlake) lucio@ifctr.mi.cnr.it (Lucio Chiappetti) pas@unh.edu (Paul A Sand) Jeff.Cole@tfn.com (Cole, Jeff) jeff@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.