![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find the string length in solaris | din_annauniv | Shell Programming and Scripting | 4 | 06-20-2008 07:43 AM |
| Awk:Find length of string omitting quotes | jayakumarrt | Shell Programming and Scripting | 2 | 05-09-2008 04:48 AM |
| ksh - read file with leading spaces | momi | Shell Programming and Scripting | 2 | 03-17-2008 03:02 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HI
In my script, i am reading the input from the user and want to find the length of the string. The input may contain leading spaces. Right now, when leading spaces are there, they are not counted. Kindly help me My script is like below. I am using the ksh. #!/usr/bin/ksh echo "enter your value" read "A" len=echo ${#A} echo "length of the string you entered is $len" output: enter your value asdf length of the string you entered is 4 NOte: I have entered 8 char (4 spaces + 4 char) Kindly help me |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|