![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking the Empty line in csv file | sollins | Shell Programming and Scripting | 4 | 05-15-2008 04:48 AM |
| how to echo the file contents LINE BY LINE | newbie168 | Shell Programming and Scripting | 4 | 02-22-2006 02:43 AM |
| if test for empty and non-existing file | GNMIKE | Shell Programming and Scripting | 3 | 10-20-2005 11:51 PM |
| empty line | YoYo | Shell Programming and Scripting | 4 | 09-21-2005 08:14 PM |
| printing an empty line in a file (perl) | kfad | Shell Programming and Scripting | 3 | 05-07-2005 12:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
What's wrong with this line: if ${TEST:?} ; then echo empty; fi
I want to print "empty" if $TEST is empty.
TEST= if ${TEST:?} ; then echo empty; fi But it doesn't work. What's wrong? |
| Forum Sponsor | ||
|
|
|
|||
|
${TEST:?} will cause your script to exit immediately. If you want to exit more
gracefully or do some cleanup, the following method of testing for an null or empty string may be more useful. Code:
#!/usr/bin/ksh TEST= if [[ ! $TEST ]] then echo "empty" fi |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|