LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 12-06-2010, 01:07 AM   #1
gurubbc
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
How to find out which shell script called?


Hi,

I have two shell scripts:

sh1.sh
======
echo "First script"
echo "Now calling second one"
sh2.sh

sh2.sh
======
echo "Second script"
In this shell script, I want to print out which shell script called this. In this case, sh1.sh called sh2.sh. So, I want to print out "sh1.sh".

How to achieve?

Thanks,
 
Old 12-06-2010, 02:00 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 97
man ps

check out parent processing id
 
  


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
Displaying Graphical Output from a PAM called Shell Script Sturmovik Linux - General 1 11-26-2009 06:45 PM
Shell script: can you tell if a script is called via an alias? BrianK Programming 11 10-01-2009 12:16 PM
Linux based java decompiler to be called from shell script rakeshrau Linux - Newbie 2 06-25-2009 09:40 AM
custom shell script interpreter is not called on my vserver empgodot Linux - Server 2 05-31-2009 08:40 AM
Writing shell script called "convert" bluewolf Programming 3 02-04-2003 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:47 PM.

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