Unix Shell - Re: Nested if doesn´t work...

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > Re: Nested if doesn´t work...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Nested if doesn´t work...
Ed Morton

2006-01-13, 10:40 pm

contracer11@gmail.com wrote:
> Please, could you tell me what´s wrong in this script ?
>
> #!/bin/ksh
> /usr/openv/volmgr/bin/vmcheckxxx -rt tld -rn 0 -list | awk '{ print $3,
> $1 }' >
> fnr0
> /usr/openv/volmgr/bin/vmcheckxxx -rt tld -rn 1 -list | awk '{ print $3,
> $1 }' >>
> fnr0
> /usr/openv/netbackup/bin/admincmd/bpmedialist -l |
> while read a b c d e f g h i j k l m n o p q r s t u v w x y
> do
> if [ $o = "8" ]
> then
> grep $a fnr0
> if [ $? -eq 0 ]
> then
> echo $a
> fi
> fi
> done
> exit 0
>
>
> Running the script I get:
>
> ./po2[2]: syntax error at line 3 : `newline or ;' unexpected
>
>
> Thanks in advance.
>


It's hard to tell with the line-wrapping, but it looks like the first
line where you invoke awk ends in ">" and the file you're trying to
direct it to (fnr0) is on the subsequent line.

Ed.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com