The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-30-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline
Disorganised User
 

Join Date: Nov 2007
Location: New Zealand
Posts: 742
Quote:
Originally Posted by by_tg View Post
UNIX script - problem.

I want the spaces in my Item variable to be replaced with a question mark. Can you tell me what I am doing wrong? This is the whole code line.

Item | tr -s " " "?"

Why is this not making any changes to the Item value?

Thanks for any help you can give!
tg
If $item is your variable, you would need to echo it and store it back into the variable again.
Eg:
Code:
item=`echo $item | tr...`
Reply With Quote