Computing.Net > Forums > Unix > Remove characters in a string

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Remove characters in a string

Reply to Message Icon

Name: Neeraja
Date: August 3, 2005 at 05:30:02 Pacific
OS: HP UX
CPU/Ram: 256MB
Comment:

Hello All,

Can anyone help me how to remove certain characters from a value which i pass through the command line when executing script

For eg: abc.sh '****this is***'

Output : this is

Thanks,
Neeraja



Sponsored Link
Ads by Google

Response Number 1
Name: vicchai
Date: August 3, 2005 at 06:04:13 Pacific
Reply:

There is only one line in the script named abc.sh

echo $1 | sed 's/\*//g'


0

Response Number 2
Name: David Perry
Date: August 3, 2005 at 06:06:38 Pacific
Reply:

echo '****this is***' | sed -e "s/\*//g"

echo '****this is***' | tr -d "*"


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Remove characters in a string

Last character in a string www.computing.net/answers/unix/last-character-in-a-string/3979.html

count the occurence of a char in a string www.computing.net/answers/unix/count-the-occurence-of-a-char-in-a-string/8516.html

detect a char in a string (ksh) www.computing.net/answers/unix/detect-a-char-in-a-string-ksh/4896.html