10-07-2008
getting results after using ps command
Hi,
I want to use the following ps coomand:
ps -ef | grep test
Result of this command is:
Test 161220 1 0 Oct 04 - 1:11 /test/test
Just mentioning the description of each value in the result:
UID PID PPID C STIME TTY TIME CMD
Test 161220 1 0 Oct 04 - 1:11 /test/test
NOW the requirement is to check the 'TTY' value and 'TIME' value. I have to do certain operations if TTY = '-' and TIME !=0:00 ..........Please help me how to do that?
Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am new to UNIX and I am more used to simple commands like those in VMS.
One of them is the ability to get the output from a job using the /out=<file> command in VMS.
I want to submit a job (a set of unix commands) using the AT command but to get the output in a file like that used in... (4 Replies)
Discussion started by: SpanishPassion
4 Replies
2. UNIX for Dummies Questions & Answers
On our one HP-UX 11i box, we have some very long paths defined. When I want to check on our user processes running, the resulting paths are chopped off. /xyz/abc/123/......./server/b is really a process running in the ..../server/bin directory. Is this a terminal problem or buffer length... (1 Reply)
Discussion started by: bsp18974
1 Replies
3. Shell Programming and Scripting
Hi
Purpose is to have a utility command to find and edit files .
I tried a function like the following in my .profile file
function vifind(){
find . -name $1 -print -exec vi {} \;
}
Is this correct? is there a better way to do it?
I see this behaving a bit strange in case of AIX, and... (6 Replies)
Discussion started by: grep_whoami
6 Replies
4. Shell Programming and Scripting
Hello community
I'd like to join to command results and put it to the same line in one file, how can I do that?
file: a.txt
so when I put Date '+%H:%M' and echo date '+%D' in the file appears 14:44 01/05/08 not
14:44
01/05/08
I like to know how can I make a substituion of a whole... (6 Replies)
Discussion started by: ncatdesigner
6 Replies
5. Shell Programming and Scripting
Hi,
I am using a command "ps -ef | grep identify" which results more than 1 results. Actually I need to get the time from each of them , compare with the current date and conditionally stop a process.
The problem I am facing is to iterate through the results getting from the command.... (4 Replies)
Discussion started by: deviprasad83
4 Replies
6. UNIX for Dummies Questions & Answers
I recently encountered this on the AIX system
df command showed usage is 100% i.e 1.5 GB while du command showed usage is only 500MB
Why are the 2 commands showing different output
This command shows usage is 1.5 GB
nlxdsm29:deqadm 24> df -k .
/usr/sap/DEQ ... (3 Replies)
Discussion started by: ameya_joshi
3 Replies
7. Shell Programming and Scripting
works as expected
$ ssh 172.24.40.100
Last login: Mon Jan 1 06:07:24 2001 from 172.24.41.78
# /path/script.sh
gives me error consistent with env setup
$ ssh 172.24.40.100 /path/script.sh
Which implies the latter is running the script.sh on host a, when I want to 'launch' in from a, and... (3 Replies)
Discussion started by: IanVaughan
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am currently reading a tar file and searching for a particular word using grep e.g. Plane. At the moment, if a sentence is found with the word "Plane" the sentence itself is piped to another file.
Here is the code i am using;
for jar in 'cat jar_file.tar'; do
tar -tvf... (3 Replies)
Discussion started by: crunchie
3 Replies
9. Shell Programming and Scripting
Sorry folks, Second time today.
I am working on a script that accepts data via pipe and processes it.
I expect it to work as:
# command | ProcScript.sh
Within ProcScript.sh, I want to be able to give the target of the prev run command
I am using history 2 | grep -v history | awk... (18 Replies)
Discussion started by: Marc G
18 Replies
10. Shell Programming and Scripting
Hi,
i have a file hello.log which as several line that look like the below
2015-12-07 09:46:56 0:339 120.111.12.12 POST /helloWorld
2015-12-07 09:46:57 0:439 122.111.12.12 POST /helloWorld
....
when i grep expecting to see results like the below.
... (6 Replies)
Discussion started by: mohtashims
6 Replies