On 5/17/07, Wade Preston Shearer <[EMAIL PROTECTED]> wrote:
I am curious how I would make searchFor and replaceWith variables.
This…
searchFor="search_for_text"
replaceWith="replace_with_text"
newString=$(echo $@ | sed 's/$searchFor/$replaceWith/')
echo $newString
The following should work:
searchFor=search_for_text
replaceWith=replace_with_text
for s in $@; do
echo $(echo "${s}" | sed "s/${searchFor}/${replaceWith}/g")
done
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/