Re: Variables in sed command?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Dan Dobbs" <DDobbs@xxxxxxxxxxxxxxxxxxx>
Reply-To: psyche-list@xxxxxxxxxx
To: <macosxwhatelse@xxxxxxxxxxx>, <psyche-list@xxxxxxxxxx>
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 Psyche-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux