|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Apr 24, 10:26am, invincible <imanuk2...@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....... |
|
![]() |
| Outils de la discussion | |
|
|