|
From: invincible on 24 Apr 2008 10:26 all, Any better ideas on implementing the below....? .. .. .. .. .. #Listing Missing Processes from the system >tmp1.out rsh $server cat /home/basks.tbl >>tmp1.out if [ -e tmp1.out ] then echo "Missing Process on system are " >>check_ps.out diff tmp1.out proc-list|awk '{ print $2 }' >>check_ps.out else echo "File NOT Found !!!! " >>check_ps.out fi done I have a list of processes in proc-list which want to compare with the ones on the system from /home/basks.tbl The problem with diff is it gives unwanted spaces in file. Thankyou
From: mop2 on 24 Apr 2008 10:47 What is "unwanted spaces"? Is more than one space between words? For this last: diff tmp1.out proc-list|awk '{ print $2 }'|tr -s ' ' >>check_ps.out Sample is best than thousand words. :) invincible wrote: > all, > > Any better ideas on implementing the below....? > . > . > . > . > . > #Listing Missing Processes from the system > >tmp1.out > rsh $server cat /home/basks.tbl >>tmp1.out > if [ -e tmp1.out ] > then > echo "Missing Process on system are " >>check_ps.out > diff tmp1.out proc-list|awk '{ print $2 }' >>check_ps.out > else > echo "File NOT Found !!!! " >>check_ps.out > fi > done > > I have a list of processes in proc-list which want to compare with the > ones on the system from /home/basks.tbl > > The problem with diff is it gives unwanted spaces in file. > > Thankyou
From: OldSchool on 24 Apr 2008 11:10 On Apr 24, 10:26 am, invincible <imanuk2...(a)googlemail.com> wrote: > all, > > Any better ideas on implementing the below....? > . > . > . > . > . > #Listing Missing Processes from the system>tmp1.out > > rsh $server cat /home/basks.tbl >>tmp1.out > if [ -e tmp1.out ] > then > echo "Missing Process on system are " >>check_ps.out > diff tmp1.out proc-list|awk '{ print $2 }' >>check_ps.out > else > echo "File NOT Found !!!! " >>check_ps.out > fi > done > > I have a list of processes in proc-list which want to compare with the > ones on the system from /home/basks.tbl > > The problem with diff is it gives unwanted spaces in file. > > Thankyou are you saying that tmp1.out contains blank lines, and that these are being reported as differences? If so, try sed "/^ *$/d" tmp1.out | diff - proc_list | awk.......
|
Pages: 1 Prev: grep doubt Next: Brand Watches Movado Women's Kara Watch #0605501 Discount, Swiss, Fake |