![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| error in if statement | capri_drm | Linux | 16 | 05-14-2008 02:00 PM |
| Error with if statement..Please help | jisha | Shell Programming and Scripting | 1 | 01-16-2008 07:13 AM |
| (sed) parsing insert statement column that crosses multiple lines | jjordan | Shell Programming and Scripting | 3 | 10-09-2007 12:23 AM |
| xml parsing error in perl | bishweshwar | UNIX for Advanced & Expert Users | 1 | 05-30-2007 10:59 PM |
| tar error statement | legato | UNIX for Dummies Questions & Answers | 3 | 03-29-2005 09:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
parsing error in if statement
hello,
I am trying to parse an error returned by a command inside the if statement but it is just displays the full error instead and then stops. Code:
if [ `pkginfo xxx | grep "was not found"` ]; then echo "no such package" else echo "similar version found will use pkgrm" fi Quote:
Thanks |
|
||||
|
Quote:
Try Code:
pkginfo xxx | grep "was not found" if test "$?" = "0" ; then echo "no such package" else echo "similar version found will use pkgrm" fi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|