![]() |
|
|
|
|
|||||||
| 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 |
| Check space utilization in recursive mode | sureshg_sampat | Shell Programming and Scripting | 1 | 06-02-2008 10:56 AM |
| Please help - disk space check script | maddhadder71 | Shell Programming and Scripting | 0 | 05-08-2008 05:16 AM |
| read string, check string length and cut | ozzy80 | Shell Programming and Scripting | 9 | 03-21-2007 02:56 PM |
| check space !!! | kamlesh_p | Shell Programming and Scripting | 2 | 11-09-2005 11:01 AM |
| Check directory space? | lesstjm | Shell Programming and Scripting | 3 | 04-19-2002 06:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
test -z $username expands to test -z a b which is a syntax error, because test -z only expects one argument. By adding double quotes, like test -z "$username", the expansion becomes test -z "a b" which has only a single, double-quoted argument. That will fix the syntax error.
However, test -z only checks for an empty string, but will treat a string with characters in it (even if they are blanks) as non-empty. I would recommend that you try the case approach instead. If it doesn't work, perhaps you can follow up here. Not to sound too harsh, but I already explained this in how to check if a string consist of any space? |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|
| Tags |
| spacing, string |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|