I plan to write a script and in the beginning, I will check if there's any existing previous process running, if YEs, then exit directly, if Not, then continue.
I can not understand, why running this script will return :
Well, I'm a little disappointed at the responses on this one... so... I'll try something a little different.
In your script, the return of 2 is happening for a very specific reason. I'll give you a clue first.
Instead of piping the ps command all the way through the word count, eliminate it and print out the return string from the ps command when you spawn it through the grave quotes.
I.e... STRING=`ps -aef | grep $0 | grep -v grep`
You will note that two lines are returned... look closely, the process ID's should give you a clue as to what the kernel is doing..
My return on a reduced example of your script is as follows:
Hello Team,
I would like to use a shell script that run each 15 minutes in order to recorder the number of process per user
I request your help in order to build an awk script under Solaris from the following command or similar:
ps -fea -o user | sort | uniq -c | sort -k 2
648 ... (3 Replies)
Hello,
I am newbie to bash scripting. Could someone help me with the following.
I have log file with output as shown below
**************************LOG*************************
11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data:
11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Hi All,
How to get the list of port numbers and it is correspoding proceses id that are currently running on. Please suggest and it is urgent
Thanks. (7 Replies)
Hi
I want to write a shell script which can find the process id's of all the process and kill them eg:
ps ax | grep rv_
3015 ? S 0:00 /home/vivek/Desktop/rv_server
3020 ? S 0:00 /home/vivek/Desktop/rv_gps
3022 ? S 0:00 /home/vivek/Desktop/rv_show
... (7 Replies)
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
I am trying to find out that how many number of threads are currently running or in any other state which is created by POSIX standard in a process.
First I have defined a variable called proc_var of type proc defined in sys/proc.h.Next I open up the dir /proc and per directory wise I do an ioctl... (7 Replies)