![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove spaces btw | tjmannonline | UNIX for Dummies Questions & Answers | 7 | 05-25-2008 11:35 PM |
| sh, ksh: command to remove front spaces from a string? | pseudocoder | Shell Programming and Scripting | 3 | 09-22-2007 04:57 AM |
| How to remove trailing spaces | mahek_bedi | UNIX for Dummies Questions & Answers | 2 | 08-10-2007 04:21 AM |
| remove blank spaces in a string | spandu | Shell Programming and Scripting | 2 | 03-01-2006 11:08 PM |
| Variable has spaces around the string, need to remove them | mikey20 | Shell Programming and Scripting | 4 | 10-13-2005 05:09 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to remove spaces in a string using sed.
Hello,
I have the following to remove spaces from beginning and end of a string. infile=`echo "$infilename" | sed 's/^ *//;s/ *$//` How do I modify the above code to remove spaces from beginning, end and in the middle of the string also. ex: Shell Programming is fun Result should be: ShellProgrammingisfun ThankYou, Radhika. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
infile=`echo "$infilename" | sed 's/ //g'`
|
|
#3
|
|||
|
|||
|
I have one more question- what is a good book for awk, sed, grep, kshell scripting for beginners like me.
ThankYou! for your prompt replies. Appreciate it! Radhika. |
|
#5
|
|||
|
|||
|
A book that I've had success with is: UNIX Shells, by Ellie Quigley. It has some typos in it but it's rather good.
|
|||
| Google The UNIX and Linux Forums |