[ale] string manipulation in sh script

Geoffrey esoteric at 3times25.net
Thu Aug 28 08:52:16 EDT 2003


Manuel Vazquez wrote:
> Hello list,
> 
> first of all, I have to say, that I am not a programmer. I only have a
> basic knowledge in scripting and so on. My problem:
> For example, I have a string "hello/world" or "/hello world" or "hello
> world/" (don't know if that makes a difference)
> 
> How can I remove the "/" or any other thing from it.

echo 'hello/world' | tr -d '/'

tr -d removes all occurances of the character in the quotes.

Understand that in the above context you'll get:

helloworld

If you'd rather replace the character with a space, do:

tr '/' ' '


Which replaces the first character in quotes with the second character 
in quotes.

> 
> Hope someone can help me. Thank you.
> 
> Manuel
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> 

-- 
Until later: Geoffrey		esoteric at 3times25.net

The latest, most widespread virus?  Microsoft end user agreement.
Think about it...

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list