Re: comando sed help
Em 26-02-2016 15:40, Anderson Bertling escreveu: Boa tarde! estou criando um script para troca de valores em configuração do bacula estou usando o comando sed e todas as edições funcionaram até agora, gostaria de adicionar abaixo de qualquer linha que tenha "signature = MD5" o comando "compression = GZIP9" já tentei de tudo mas não surge resultado alguém pode ajudar desde já fico grato... Olá! Faça assim: sed '/signature = MD5/a\compression = GZIP9' -- []'s Junior Polegato
comando sed help
Boa tarde! estou criando um script para troca de valores em configuração do bacula estou usando o comando sed e todas as edições funcionaram até agora, gostaria de adicionar abaixo de qualquer linha que tenha "signature = MD5" o comando "compression = GZIP9" já tentei de tudo mas não surge resultado alguém pode ajudar desde já fico grato... -- Att Anderson Bertling
sed help please
Hi, I've come up with this sed command: sed s//media// filename One question, how can I include the / charactar in the search patton? This works fine except, I need to add a / in the search patton, any ideas how to do this so sed doesn't complain? Thanks very much, Daniel. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: sed help please
Hi Daniel, On Tue, Jan 27, 2009 at 09:35:46PM +1100, Daniel Dalton wrote: Hi, I've come up with this sed command: sed s//media// filename One question, how can I include the / charactar in the search patton? This works fine except, I need to add a / in the search patton, any ideas how to do this so sed doesn't complain? Use a backslash \ bevor the slash/: \/ works fine Axel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: sed help please
Axel Freyn (2009-01-27 12:11 +0100) wrote: On Tue, Jan 27, 2009 at 09:35:46PM +1100, Daniel Dalton wrote: sed s//media// filename One question, how can I include the / charactar in the search patton? This works fine except, I need to add a / in the search patton, any ideas how to do this so sed doesn't complain? Use a backslash \ bevor the slash/: \/ works fine Yes, or use some other character to separate the parameters of s command. This example uses comma: sed -e 's,pattern,replacement,' Then / does not need backslash-escaping but , does. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: sed help please
Hi Axel, Use a backslash \ bevor the slash/: \/ works fine Thanks, very much, that worked! Cheers, Daniel. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: SED help........
On Fri, Apr 23, 2004 at 11:39:32AM -0400, Ralph Crongeyer wrote: Hi all, I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log --move=/var/log/clamav/quarantine / /var/log/clamav/diff/diff.txt /var/log/clamav/virus_scan 1. There is no 2nd ' (should it be after clamscan?) 2. s/.*/clamscan means (I think) that the whole line is replaced with the word clamscan which is probably not what you want. but sed givs me this error: sed: -e expression #1, char 23: Unknown option to 's' I have also tried to use the insert command i\ but it just inserts the text on a new line above each of the lines read from the file instead of just inserting the text at the beginning of each of the lines red from the file? Can someone help me with this? Ralph HTH -- Joachim Fahnenmüller # Hi! I'm a .signature virus. Copy me into # your ~/.signature to help me spread! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: SED help........
Ralph Crongeyer wrote: Hi all, I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log --move=/var/log/clamav/quarantine / /var/log/clamav/diff/diff.txt /var/log/clamav/virus_scan but sed givs me this error: sed: -e expression #1, char 23: Unknown option to 's' I have also tried to use the insert command i\ but it just inserts the text on a new line above each of the lines read from the file instead of just inserting the text at the beginning of each of the lines red from the file? Can someone help me with this? Ralph It's difficult to tell exactly what your 2 expressions are. But I see forward slashes (/'s) all over that. To use an s commad through sed is: sed 's/searchFor/replaceWith/' so if you have any / inside your expressions you need to escape them: sed 's/search\/For/replace\/With/' If you look at the error msg again char 23: Unkown option, it's picking your 3rd slash in char position 22 as the final / delimiter for the s command. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
SED help........
Hi all, I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log --move=/var/log/clamav/quarantine / /var/log/clamav/diff/diff.txt /var/log/clamav/virus_scan but sed givs me this error: sed: -e expression #1, char 23: Unknown option to 's' I have also tried to use the insert command i\ but it just inserts the text on a new line above each of the lines read from the file instead of just inserting the text at the beginning of each of the lines red from the file? Can someone help me with this? Ralph -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: SED help........
Incoming from Ralph Crongeyer: I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log /var/log/clamav/virus_scan BTW, this is _debian-user_, not sed-user. Try something simpler, and work up from there: sed 's/^/blah/g' infile outfile -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: SED help........
on Fri, Apr 23, 2004 at 11:39:32AM -0400, Ralph Crongeyer ([EMAIL PROTECTED]) wrote: Hi all, I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log --move=/var/log/clamav/quarantine / /var/log/clamav/diff/diff.txt /var/log/clamav/virus_scan Showing a sample of the lines you're trying to change would be useful. It's hard to tell just from your (broken) regex substitution. but sed givs me this error: sed: -e expression #1, char 23: Unknown option to 's' A few things. - .* matches the whole line. Is this what you're trying to change? If you just want to match start of line, use '^' instead. - / is the default sed argument delimiter. If you're using / within your regex *OR* substitution, you must escape it (\/) *OR* use an alternate delimiter. Generally some syntactic character will work, any of: .,:|, etc. - sed expressions must be contained on one line. - sed expressions on the shell should include *both* open *and* close quotes. I think what you want is the following: sed 's,^,clamscan -ri -l /var/log/clamav/clamav-$1.log --move=/var/log/clamav/quarantine,' \ /var/log/clamav/diff/diff.txt /var/log/clamav/virus_scan I have also tried to use the insert command i\ but it just inserts the text on a new line above each of the lines read from the file instead of just inserting the text at the beginning of each of the lines red from the file? s/red/read/ Correct. Peace. -- Karsten M. Self [EMAIL PROTECTED]http://kmself.home.netcom.com/ What Part of Gestalt don't you understand? Save Bob Edwards! http://www.savebobedwards.com/ signature.asc Description: Digital signature
Re: SED help........
on Fri, Apr 23, 2004 at 11:36:18AM -0600, s. keeling ([EMAIL PROTECTED]) wrote: Incoming from Ralph Crongeyer: I need some help with SED. I'm trying to insert a command/text at the beginning of every line from one file and output to a new file like this: sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-$1.log /var/log/clamav/virus_scan BTW, this is _debian-user_, not sed-user. If you don't want to answer a post, don't answer a post. Peace. -- Karsten M. Self [EMAIL PROTECTED]http://kmself.home.netcom.com/ What Part of Gestalt don't you understand? Save Bob Edwards! http://www.savebobedwards.com/ signature.asc Description: Digital signature
Re: sed help
On Fri, Feb 07, 2003 at 04:06:06PM +0900, Geengun Guim wrote: The identity is not www but the first +- simbol. c:\tmp\mbc+-www.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cs.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cdi.kbs.co.kr+-cgi-bin+-cgi.cgi [...] Besides, I'd like to insert ping 66.66.66.66 everylines for waiting several seconds.. So the last output is like, www.mbc.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 cs.mbc.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 cdi.kbs.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 cat test.txt c:\tmp\mbc+-www.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cs.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cdi.kbs.co.kr+-cgi-bin+-cgi.cgi sed -e 's/c:\\tmp\\mbc+-//' -e 'a\ ping 66.66.66.66 ' test.txt -- Seneca [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
sed help
Hi? Elie De Brauwer [EMAIL PROTECTED] helped me before. but I cannot touch with him.why. so ask you please help me The identity is not www but the first +- simbol. c:\tmp\mbc+-www.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cs.mbc.co.kr+-cgi-bin+-cgi.cgi c:\tmp\mbc+-cdi.kbs.co.kr+-cgi-bin+-cgi.cgi = www.mbc.co.kr+-cgi-bin+-cgi.cgi cs.mbc.co.kr+-cgi-bin+-cgi.cgi cdi.kbs.co.kr+-cgi-bin+-cgi.cgi Please help again.. Besides, I'd like to insert ping 66.66.66.66 everylines for waiting several seconds.. So the last output is like, www.mbc.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 cs.mbc.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 cdi.kbs.co.kr+-cgi-bin+-cgi.cgi ping 66.66.66.66 Thanks, GGG - Original Message - From: Elie De Brauwer [EMAIL PROTECTED] To: behapy [EMAIL PROTECTED] Sent: Tuesday, February 04, 2003 4:09 PM Subject: Re: sed GURU help me~ something like this ? helios@Kafka:~$ cat test.txt c:\tmp\kbs+-www.kbs.co.kr+-cgi-bin+-test.cgi c:\tmp\mbc+-www.mbc.co.kr+cgi-bn+-sample.cgi c:\tmp\sbs+-www.sbs.co.kr+-cwb-bin+-sbs.cgi helios@Kafka:~$ cat test.txt | sed 's/\(.*\)\(www.*$\)/move\ \\1\2\\ \2/' move c:\tmp\kbs+-www.kbs.co.kr+-cgi-bin+-test.cgi www.kbs.co.kr+-cgi-bin+-test.cgi move c:\tmp\mbc+-www.mbc.co.kr+cgi-bn+-sample.cgi www.mbc.co.kr+cgi-bn+-sample.cgi move c:\tmp\sbs+-www.sbs.co.kr+-cwb-bin+-sbs.cgi www.sbs.co.kr+-cwb-bin+-sbs.cgi hth Thank you for the answer before.. c:\tmp\kbs+-www.kbs.co.kr+-cgi-bin+-test.cgi c:\tmp\mbc+-www.mbc.co.kr+cgi-bn+-sample.cgi c:\tmp\sbs+-www.sbs.co.kr+-cwb-bin+-sbs.cgi = I'd like to change the above to the below.. move c:\tmp\kbs+-www.kbs.co.kr+-cgi-bin+-test.cgi www.kbs.co.kr+-cgi-bin+-test.cgi move c:\tmp\mbc+-www.mbc.co.kr+cgi-bn+-sample.cgi www.mbc.co.kr+cgi-bn+-sample.cgi move c:\tmp\sbs+-www.sbs.co.kr+-cwb-bin+-sbs.cgi www.sbs.co.kr+-cwb-bin+-sbs.cgi sed -e s/^insert move insert again only www.~~ Please help me sed GURU.. Thanks, GGG -- = Elie De Brauwer www.de-brauwer.be = N I@R é[huæâj{¬zºÞªç¬¶X¬¶Ç^n§¢¸0ØZ²æãyËh~éì¹»®ÞNº.nW¢{ZrÙb²Ù²×«+-±×©è®