You don't need to count how many lines grep outputs to tell whether it matches anything or not: grep tells you directly, returning zero if it found anything, nonzero if it didn't, letting you plug it directly into an if or other logical statement.
Try
The '[e]xecute' avoids needing grep -v grep, since the regular expression '[e]xecute' will still match the string "execute" but won't match the string "[e]xecute".
I am running a number of processes through a kill -15 loop as a temporary fix to some viscious memory leaks. I cannot pass the entire list of processes through the kill at once, because the nature of the monitoring my client has will cause the software to failover.
Because of the large number of... (1 Reply)
I am in need of some help; think I have confused myself.
Here is the issue I am faced with.
The script log file was fine, the nohup.out file has tens of thousands of lines like illegal use of sleep: sleep seconds
So I assume there is something with the seconds calculation in the script... (1 Reply)
Hi All I have a requiremnt to run a script inside another script.
here i am pulling the record count from the table in oracle.If record count is greater than 0 the script is executed.The scripts updates the count in the table and again the count is found out and the condition is checked and same... (3 Replies)
Hi Forum
Im using sleep in a while loop goes around 10 times. i feed it a variable with the time i what it to sleep for eg sleep $sleepVal and then print system date and time to screen but sometimes 1 second is added to the time why is this
here my code
sleepVal=5
while
do
... (3 Replies)
Hi All,
i am very new to shall script . i am not that much aware of sleep command ,
i want to terminate the sleep command after certain time.
following is my code.
while
loop
sleep 1800
messag=/status.sql
donethe script will be on sleep untill the messag be comes P. here my requirement... (4 Replies)
Hi Frnz,
I need to execute sleep command but i dont know the definite time.
Let me put my req:
I am running one shell script and this script creates some lock file in temp dir ...now in my script i want one function to go into sleep mode till this lock file exists..one lock file gone that... (6 Replies)
I need help in script.
I want my one script execute every time at 6:30 am and i have no cron access.
So i am putting sleep command there , Script may took half an hour 35 min , it depend upon queries how much it take time, but that is not issue,
So i want according to stop time of... (15 Replies)
Discussion started by: pallvi_mahajan
15 Replies
LEARN ABOUT OSF1
lastcomm
lastcomm(8) System Manager's Manual lastcomm(8)NAME
lastcomm - Outputs information about the last commands executed
SYNOPSIS
lastcomm [Command] [Name] [Tty]
DESCRIPTION
The lastcomm command outputs information about all previously executed commands that are recorded in the /var/adm/pacct file in reverse
chronological order.
You may specify a particular command with the Command parameter, a particular user with the Name parameter, and a particular terminal as
the command source with the Tty parameter. Output is then restricted to the specified parameters. A Tty terminal may be named fully (for
example, tty0) or abbreviated (for example, 0).
The following information is displayed for each process: Name of the command under which the process was called. Any flags collected when
the command was executed. The following flags are valid: Command was run with an effective user-id of 0. Command ran after a fork, but
without an exec system call following it. Name of the user who issued the command. The terminal the command was started from. Seconds of
CPU time used. Time the process started.
EXAMPLES
To display information about all previously executed commands recorded in the /var/adm/pacct file, enter: lastcomm Information is displayed
similar to: lastcomm ajh lat/620 1.13 secs Thu Feb 24 15:02 pg ajh lat/620 5.91 secs Thu Feb 24 15:01
ln miller ttyp1 1.14 secs Thu Feb 24 15:01 ls rob ttyp1 0.02 secs Thu Feb 24 15:01 pg
sjz ttyp1 0.33 secs Thu Feb 24 15:00 sendmail SF root __ 0.01 secs Thu Feb 24 15:00 To display information
about commands named a.out executed by the root user on terminal ttyd0, enter: lastcomm a.out root ttyd0
FILES
Specifies the command path. The current accounting file.
RELATED INFORMATION
Commands: last(8) delim off
lastcomm(8)