November 25, 2024, 04:11:11 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: LINUX SCRIPT FOR GETING THE NEWSET PID  (Read 10452 times)

Offline santosh

  • New Member
  • Posts: 2
LINUX SCRIPT FOR GETING THE NEWSET PID
« on: May 07, 2004, 11:56:08 AM »
hi the follwing script will display all the PID's

ps -ef | grep "$1" | grep -v grep | awk '{print $1}'

but i want a script which displays only the newest PID generated.

Offline santosh

  • New Member
  • Posts: 2
LINUX SCRIPT FOR GETING THE NEWSET PID
« Reply #1 on: May 08, 2004, 03:41:07 AM »
and does some one know to run the same script using php

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
LINUX SCRIPT FOR GETING THE NEWSET PID
« Reply #2 on: May 08, 2004, 05:31:06 PM »
U can try to use program execution functions in php such as

exec(); to make it run on ur webserver.

Prototype for exec()

exec(string command [ array result[, int return value]])

For example:

exec("ls -la");