04-04-2008
234,
0
Join Date: Nov 2006
Last Activity: 25 September 2009, 6:39 AM EDT
Posts: 234
Thanks Given: 0
Thanked 0 Times in 0 Posts
test wordcount
Hello
I want to run this test:
If wordcount of a command is 0 then echo XXXX else echo YYYYY
if [ `cat /tmp/foobar.txt | awk '{print $2}' | grep database | grep -v `df -k |grep /dev/dsk | awk '{print $6}'` | wc -l` != 0 ]; then echo "all devices are created on RAID10"; else echo "Some devices are created on non-RAID10"; fi
I receive this message
-bash: command substitution: line 1: syntax error near unexpected token `|'
-bash: command substitution: line 1: ` | wc -l'
Usage: grep -hblcnsviw pattern file . . .
awk: can't open !=
-bash: [: missing `]'
Some devices are created on non-RAID10
Can you please advise?
bash$ cat /tmp/foobar.txt | awk '{print $2}' | grep database | grep -v `df -k |grep /dev/dsk | awk '{print $6}'` | wc -l
34