Computing.Net > Forums > Unix > How to get rid of a "," at the end of a variable read

How to get rid of a "," at the end of a variable read

Reply to Message Icon

Original Message
Name: Rogine
Date: April 27, 2000 at 08:18:58 Pacific
Subject: How to get rid of a "," at the end of a variable read
Comment:

I want to get rid of the "," at the end of variable, and then make a directory using the varable name. For example, if the varaible = "Harry,"
I want to make a directory Harry

I have tried:
mkdir $variable|tr -d ,
But the directory made is Harry, (with the ",") instead of Harry.

How can I get rid of the ","


Report Offensive Message For Removal


Response Number 1
Name: Anthony
Date: April 28, 2000 at 04:45:58 Pacific
Reply: (edit)

Try this:

mkdir `echo $variable | sed 's/,//'`


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: How to get rid of a "," at the end of a variable read

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge