LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-07-2006, 10:18 AM   #1
eur0dad
Member
 
Registered: Jul 2006
Posts: 57

Rep: Reputation: 15
BASH: Removing ALL whitespace from variable


I figured something like this would work
X=${X/ /}

But it doesn't... how can I go about removing ALL whitespace from $X? Example content of $X is: "abc = 123", so I want "abc=123"
 
Old 09-07-2006, 10:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,452
Blog Entries: 54

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
Just missed one slash:
X=${X// /}
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash, how to get variable name from variable Duudson Programming 6 01-06-2005 04:38 PM
bash month variable johniccp Linux - Newbie 1 12-06-2004 01:41 PM
problem creating BASH script with files that have whitespace scattaneo Linux - General 2 11-06-2004 05:40 PM
Variable with bash pinkysioux Programming 6 04-15-2004 08:46 PM
Using sed in bash to remove whitespace jimieee Programming 3 01-28-2004 10:33 AM


All times are GMT -5. The time now is 07:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration