The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How to replace a variable content
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How to replace a variable content
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
06-23-2006
vino
Supporter (in vino veritas)
Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
I am not aware of any shell-builtins' (except for the ones Ygor posted) which carries out string replacement.
Try
sed
Code:
echo "$variable" |
sed
-e "s_car_dog_g"
awk can do it as well. Look into the gsub method.
vino
View Public Profile
Find all posts by vino
Find vino's past nominations received
Find vino's present nominations given