LinuxQuestions.org
Review your favorite Linux distribution.
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 05-17-2016, 05:22 AM   #1
LinuxDeian
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: Disabled
Question Systems call integrated to shell script


Good day all

I would like to integrate a sys call to my shell script,
as for example be able to use the syscall function getpid() to get the current running process id.

what I did was to create a shell script menu where one of the option is to get the current process identifier and for that I want to use getpid().

If anyone as a solution to how to do that please help.
 
Old 05-17-2016, 05:41 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
What's wrong with the use of:

Code:
echo "My PID is $$"
in bash?
 
1 members found this post helpful.
Old 05-17-2016, 06:15 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
xyproblem.info
 
Old 05-17-2016, 09:23 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Quote:
Originally Posted by TenTenths View Post
What's wrong with the use of:

Code:
echo "My PID is $$"
in bash?
Learn something new EVERYDAY!

@OP, entirely valid. Perhaps you can elaborate if there is a different end-game for all of your efforts.
 
  


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
[rant] Shell script integrated search engine?! Weapon S General 3 08-29-2013 02:31 AM
Call makefile from shell script YaMaHaBoB Linux - General 2 04-12-2011 06:22 PM
call shell script in perl pm imhere Programming 10 09-25-2010 01:34 AM
how to call a script in a new shell from the current shell Bone11409 Linux - Newbie 2 05-04-2010 05:11 AM
Shell Script call API treotan Programming 1 08-22-2005 11:59 PM


All times are GMT -5. The time now is 04:01 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