LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 12: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, 01:00 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
man ps

check out parent processing id
 
  


Reply



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

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

All times are GMT -5. The time now is 04:17 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
Open Source Consulting | Domain Registration