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 08-14-2015, 02:09 AM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 111

Rep: Reputation: Disabled
pid is not printing in shell script


Hi,

PID is not printing when running the same cmd in shell script. plz help.

[root@localhost ~]# nice -4 cat /dev/zero > /dev/null &
[1] 4913
[root@localhost ~]#
[root@localhost ~]# cat ss
nice -4 cat /dev/zero > /dev/null &
[root@localhost ~]# ./ss
[root@localhost ~]#
 
Old 08-14-2015, 02:58 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by arun natarajan View Post
plz help.
With what? This is normal.

If you want to get the process id of a command, check out $!

A "bash get process id" with DuckDuckGo yields:
http://stackoverflow.com/questions/9...-and-exit-code



And if you read this, it will be easier to get help in the future...
http://catb.org/~esr/faqs/smart-questions.html


Best regards,
HMW
 
  


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
question on PID's and Executing a shell script jonhanna Linux - Newbie 3 12-30-2008 12:39 PM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
Find parent PID in shell script ? bugmenot Programming 7 02-07-2007 12:09 PM
obtaining PID of shell script sanjith11 Programming 3 07-14-2004 10:43 AM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 06:25 PM

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

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