Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-24-2005, 04:57 PM   #1
Registered: May 2003
Location: USA
Distribution: Fedora 21, RHEL 5,6&7, Windoze 7
Posts: 235

Rep: Reputation: 31
what is the calling file?

file A is ran by file B. I know the name of file A but not B. How can i find out the name of file B?
A is a shell script.

Old 02-24-2005, 05:06 PM   #2
Andrew Benton
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
read man fuser
Old 02-24-2005, 05:11 PM   #3
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Another option would be pstree. fuser will work nicely, unless script A runs too quickly for you to run the command manually. Or I guess you could put an fuser command in the script in a similar way to what I mention below.

Modify script A to include a pstree command, that has its output redirected to a file. Something like this:
pstree -p > /tmp/script_A_pstree_$$.out
Then you can open the output file, and search for the PID of script A. The script's PID is recorded in the filename itself; that's what the $$ expands to. The diagram should show you what process started the script.

Just be sure to remove the pstree command from the script once you find out. Otherwise, you'll chew through disk space, saving pstree output everytime the script runs.
Old 02-25-2005, 09:15 AM   #4
Registered: May 2003
Location: USA
Distribution: Fedora 21, RHEL 5,6&7, Windoze 7
Posts: 235

Original Poster
Rep: Reputation: 31
thank you both for your help



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in calling multiple files in one file ajindal Programming 1 08-23-2005 12:08 PM
calling all hackers evilmonk Linux - Software 4 03-12-2005 10:13 PM
odd recursion: calling "by hand" vs calling by cronscript... prx Programming 4 02-12-2005 04:59 PM
Calling a Php file from CRON every hours ? airbuzz *BSD 10 02-03-2004 02:04 PM
c++ calling bash? adam_boz Programming 4 10-23-2002 12:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration