Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove spaces from string 1

Status
Not open for further replies.
Mar 31, 2004
151
0
0
US
Can we remove spaces from a string variable?

Ex: If $var has 10 20 2003, it should become 10202003.

Thanks.

 
Something like this ?
var=$(echo "$var" | sed 's! !!g')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top