LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-24-2005, 04:57 PM   #1
youngstorm
Member
 
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.

thx
Michael
 
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
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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:
Code:
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
youngstorm
Member
 
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

Michael
 
  


Reply


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


All times are GMT -5. The time now is 06:53 AM.

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