Different cmd to execute and based on some pattern parse it and then store result in xlx format


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Different cmd to execute and based on some pattern parse it and then store result in xlx format
# 1  
Old 01-18-2013
Linux Different cmd to execute and based on some pattern parse it and then store result in xlx format

Hi
I have a different requirement,
I need to run some application on my device from a file app_name.txt one by one which is like this:

/usr/apps/email
/usr/apps/message
/usr/apps/settings

after each app while it is running I need to execute again one cmd like

ps -ef |grep /usr/apps/email

then this cmd will give output like this:

user 6423 6602 0 11:23 pts/4 00:00:00 /usr/apps/email

on this output I need to extract the 2nd, 3rd and last column value only and store it to another excel format file(result.xls) whose format will be like:

/usr/apps/email 6423 6602 13025
(sum of the 2 column value)

This all will be executed like same for all other app name from the file app_name.txt

please help me for this script as I am new to this and dont have much idea abt cmds of shell script.
# 2  
Old 01-18-2013
Is this a homework item? Adding a process's process ID to its parent's process ID doesn't seem to have any real world value.
# 3  
Old 01-18-2013
its an example command....actually I need to execute some memory profiling command which gives output like this so I put some real command output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search a multi-line shell command output and execute logic based on result

The following is a multi-line shell command example: $cargo build Compiling prawn v0.1.0 (/Users/ag/rust/prawn) error: failed to resolve: could not find `setup_panix` in `human_panic` --> src/main.rs:14:22 | 14 | human_panic::setup_panix!(); | ... (2 Replies)
Discussion started by: yogi
2 Replies

2. Programming

How to parse .nessus file to get result in human readable format?

Scripting Language: bash shell script, python I want to parse .nessus file in human readable format. If any one have any ideas please help me. (2 Replies)
Discussion started by: sk151993
2 Replies

3. Shell Programming and Scripting

Store result variable

Friends have the following problem: cat $PATH_DAT/mr.txt | nawk 'BEGIN { CantPnt=0; NumReg=0; FS="|" } { NumReg++ CantPnt=CantPnt+int($2) } END{ printf... (5 Replies)
Discussion started by: tricampeon81
5 Replies

4. Shell Programming and Scripting

awk to parse file and display result based on text

I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Discussion started by: cmccabe
6 Replies

5. Shell Programming and Scripting

Execute command using ssh server 'cmd'

Hi The command below does not work as it require to take command in the breakers But If I do so the variable values get lost ssh testserver01 'dsmc q b "${ARCHIVE_DIR}*" -sub=yes -querysummary -inactive -fromd="${BACKUP_DATE}"' Thank you. (3 Replies)
Discussion started by: zam
3 Replies

6. Shell Programming and Scripting

Telnet using port and execute cmd

Hi, my query is: I am Login on server with IP xxx.xxx.xxx.xxx.. and i want a script where i want to telnet to server with IP yyy.yyy.yyy.yyy using specific port and then execute a cmd there on server Y please suggest (1 Reply)
Discussion started by: dodasajan
1 Replies

7. Shell Programming and Scripting

How to store result of grep into a variable?

In a directory i have a file *output* whose contents are changing for every simulation. zgrep "trace file is" *output* | zgrep g o/p: trace file is Int_01.1352176388z4f56ec33.0.trace.gz I want to extract "Int_01.1352176388z4f56ec33.0.trace.gz" from the above result into a variable. i... (2 Replies)
Discussion started by: twistedpair
2 Replies

8. Linux

How to execute nohup cmd

Hi, nohup sar -u 10 $COUNT | awk 'NR>2 {$2=$4=$7="";}1' | tr -s ' ' '\t' 2>/dev/null >sar.out & i have execute above line from shell script .. but sar.out is created with ZERO bite size.. Help on that what is the problem here Thx, Mani (0 Replies)
Discussion started by: Mani_apr08
0 Replies

9. HP-UX

awk to output cmd result

I was wondering if it was possible to tell awk to print the output of a command in the print. .... | awk '{print $0}' I would like it to print the date right before $0, so something like (this doesn't work though) .... | awk '{print date $0}' (4 Replies)
Discussion started by: IMTheNachoMan
4 Replies

10. UNIX and Linux Applications

How to get a result of a cmd into variable?

Hi , I am trying following . I need to get a result of an autosys cmd into a unix variable. The autosys cmd is autostatus -G jpm_day_today Please help me in storing the value returned by this cmd into a unix variable. Appreciate your time to read this post. (1 Reply)
Discussion started by: manchau
1 Replies
Login or Register to Ask a Question