  | |  | Variables in sed command? | Variables in sed command? 2003-07-28 - By jim car
Back >From: "Dan Dobbs" <DDobbs@(protected)> >Reply-To: psyche-list@(protected) >To: <macosxwhatelse@(protected)>, <psyche-list@(protected)> >Subject: Re: Variables in sed command? >Date: Mon, 28 Jul 2003 06:52:02 -0700 > >have you tried sed 's/1108/$startline/g' /etc/httpd/conf/httpd.conf > >/etc/httpd/conf/httpd.tmp ? > >-dd
I don't think that would work since the starting and ending line numbers would change with each run of the script. Tim's suggestion did work. I am curious if anyone knows how to get this to work.
linenum=`grep -n /home/$domain /etc/httpd/conf/httpd.conf | awk -F: '{print $1;exit}'`
in an expect script. It always errors out stating that the $1 is not a variable.
can't read "1": no such variable while executing "send -- "linenum=`grep -n /home/$domain /etc/httpd/conf/httpd.conf | awk -F: '{print $1;exit}'`\r"" (file "./rmdomain.exp" line 43)
Also, the expect script slows down half way thru. I do have sleep 1 commands in it to make sure that the passwd command doesn't get over run, but not the rest of it because they are straight commands like grep, cat, cp, etc.
Any help would be appreciated.
Jim
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
Earn $52 per hosting referral at Lunarpages.
|
|
 |