Re: Variables in sed command?

"jim car" <[email protected]>
Newsgroups gmane.linux.redhat.release.psyche
Message-ID <[email protected]>
>From: "Dan Dobbs" <[email protected]>
>Reply-To: [email protected]
>To: <[email protected]>, <[email 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


-- 
Psyche-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/psyche-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.