![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| TAHI Test Suite 3.0.13 (IPv6 Conformance Test Tool branch) | iBot | Software Releases - RSS News | 0 | 04-06-2008 01:20 PM |
| test and .test in same directory | vikashtulsiyan | SUN Solaris | 14 | 12-28-2007 02:25 AM |
| Keithley Introduces Linux-Based RF Parametric Test Systems - Test and Measurement.com | iBot | UNIX and Linux RSS News | 0 | 07-23-2007 11:30 AM |
| Test Help!!!!!! | Xskwizitboi | UNIX for Dummies Questions & Answers | 1 | 12-02-2004 01:35 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
my guess is that you'll need to escape the inner backticks.. try it out and see if it works..
in my opinion it makes the code, well, a little difficult to understand and maintain by an average person, so i'd recommend so break it up a little. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|