![]() |
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 |
| 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 |
| how can I read the space in the end of line | Ehab | UNIX for Advanced & Expert Users | 2 | 09-30-2007 11:13 AM |
| Consecutive spaces within input being converted to single space | NinersFan | Shell Programming and Scripting | 4 | 09-04-2007 09:59 AM |
| read a part of filename from the list in the script | happyv | Shell Programming and Scripting | 3 | 10-20-2006 10:58 AM |
| rsync problem - space character in filename | chief2 | UNIX for Dummies Questions & Answers | 3 | 09-24-2004 12:06 PM |
| filename that starts with a space | noobie_doo | UNIX for Dummies Questions & Answers | 6 | 09-09-2002 06:51 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to read double consecutive space in filename for bash shell
Hello,
Im using cygwin app which we use the bash shell for scripting. Im trying to read a filename with consecutive spaces on the filename ex: filename<space><space>1.txt ls -lrt filename<space><space>1.txt is working but when I pull that from a file and place it into variable. it reads only as single space: filename<space>1.txt ex: cat samp.txt output: 1:filename<space><space>2.txt 2:filename<space><space>1.txt 3:filename<space><space>3.txt var1=`cat samp.txt |sed -n -2p |awk '{print $NF}'` echo $var1 output: filename<space>1.txt Please advice how to read double consecutive spaces. Is there any escape characters? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|