BB Unix Network Monitor - Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
{bb} {BB} OT: sed problem..
Hi brothers,
With all the script guru's here I thought maybe one of you might be able
to help out with a weird problem. I'm trying to escape the slashes in a
date so I can use it in another search and replace. however it dos work
from a normal command prompt, but not in a subshell:
noob$ echo $session
2006/23/12
noob$ echo $session | sed -e 's/\//\\\//g'
2006\/23\/12
noob$ session_reg=`echo $session | sed -e 's/\//\\\//g'`
sed: Function s/\//\\//g cannot be parsed.
in the end I like to use ${session_reg} in the following line:
cat backup.log | sed -e "s/${session_reg}/<A
href=\"${session_html}.html\">${session_reg}<\/a>/" > backup.html
the ${session_html} is created with the following ilne (and works..):
session_html=`echo $session | sed -e 's/\//_/g'`
Greetings,
/Frank.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.
Home |
Main Index |
Thread Index