LinuxQuestions.org
Help answer threads with 0 replies.
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 05-17-2016, 04: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, 04:41 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

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

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

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
xyproblem.info
 
Old 05-17-2016, 08:23 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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



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 01:31 AM
Call makefile from shell script YaMaHaBoB Linux - General 2 04-12-2011 05:22 PM
call shell script in perl pm imhere Programming 10 09-25-2010 12:34 AM
how to call a script in a new shell from the current shell Bone11409 Linux - Newbie 2 05-04-2010 04:11 AM
Shell Script call API treotan Programming 1 08-22-2005 10:59 PM

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

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