![]() |
|
|
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 |
| length of string | silas.john | UNIX for Dummies Questions & Answers | 8 | 02-06-2008 07:22 PM |
| read string, check string length and cut | ozzy80 | Shell Programming and Scripting | 9 | 03-21-2007 05:56 PM |
| sed problem - replacement string should be same length as matching string. | amangeles | Shell Programming and Scripting | 4 | 01-11-2006 06:11 AM |
| String length in ksh | ssgrpid | Shell Programming and Scripting | 4 | 08-03-2005 02:39 PM |
| length of the string | vasikaran | UNIX for Dummies Questions & Answers | 3 | 06-30-2005 05:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ghostdog74: If $var contains whitespace or special characters, it needs to be double-quoted. The solution posted by Franklin52 seems more succinct and workable anyway; the built-in ${#var} length operator doesn't require any external processes, and doesn't have issues with quoting etc.
|
![]() |
| Bookmarks |
| Tags |
| shell, variable length |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|