Re: sed question

2019-12-07 Thread Michael
On Friday, December 6, 2019 6:06:10 PM CET, songbird wrote: result=`echo "summary: \"\"" | sed -e "s/^summary: .*$/summary: \"${old_summary}\"/"` of course this doesn't work. since you use '/' (slash) as delimiter in the sed expression, the slash in $old_summary is interpreted as the delimite

Re: sed question

2019-12-07 Thread Andrei POPESCU
On Vi, 06 dec 19, 14:50:51, Greg Wooledge wrote: > On Fri, Dec 06, 2019 at 02:40:49PM -0500, songbird wrote: > > Greg Wooledge wrote: > > ... > > > Ideally, you'd just stop trying to use sed with user-supplied variables > > > injected into the code. Sed was never built to be safe for that kind of

Re: sed question

2019-12-07 Thread Andrei POPESCU
On Vi, 06 dec 19, 14:40:49, songbird wrote: > > the point of doing something in bash is to do it quick and > see if the concept is useful enough. if enough people decide > to use it then it can be more formalized. We often build prototypes / proof-of-concept / experiments that live much longe

Re: sed question

2019-12-07 Thread Jeremy Nicoll
On Sat, 7 Dec 2019, at 14:20, songbird wrote: > The Wanderer wrote: > > ... about various characters and then @ in particular ... > > > As far as I can see, at least on my keyboard, that pretty much just > > leaves @. It does still sometimes occur in paths and filenames, so it's > > not really i

Re: Alternate delimiters (for sed) above decimal 127? (was Re: sed question)

2019-12-07 Thread David Wright
On Sat 07 Dec 2019 at 09:27:59 (-0500), rhkra...@gmail.com wrote: > On Saturday, December 07, 2019 07:20:35 AM The Wanderer wrote: > > Yep - using '/' is only a standard convention, it's not required. When > > writing an s-expression which I know will be passed a path, I generally > > use '@' mysel

Re: sed question

2019-12-07 Thread songbird
Andrei POPESCU wrote: ... pre processing for that one character using a different delimiter and then processing the results of that with the original delimiter seems to cover everything i'm worried about. :) > One trick to avoid this problems is to use a different delimiter, e.g. '|'. > > Acco

Re: sed question

2019-12-07 Thread songbird
The Wanderer wrote: ... about various characters and then @ in particular ... > As far as I can see, at least on my keyboard, that pretty much just > leaves @. It does still sometimes occur in paths and filenames, so it's > not really ideal, but it's probably less common there than any of the >

Alternate delimiters (for sed) above decimal 127? (was Re: sed question)

2019-12-07 Thread rhkramer
On Saturday, December 07, 2019 07:20:35 AM The Wanderer wrote: > Yep - using '/' is only a standard convention, it's not required. When > writing an s-expression which I know will be passed a path, I generally > use '@' myself; that A: is conveniently typable on the keyboard, B: is a > comparativel

Re: sed question

2019-12-07 Thread The Wanderer
On 2019-12-07 at 04:43, Andrei POPESCU wrote: > On Vi, 06 dec 19, 16:15:51, songbird wrote: > >> The Wanderer wrote: >>> >>> For example, 's/hello/newstring/' would be a valid sed >>> 's'-expression, but 's/a/b/newstring/' would not; the former >>> contains three instances of the delimiting toke

Re: sed question

2019-12-07 Thread Andrei POPESCU
On Vi, 06 dec 19, 16:15:51, songbird wrote: > The Wanderer wrote: > > > > For example, 's/hello/newstring/' would be a valid sed 's'-expression, > > but 's/a/b/newstring/' would not; the former contains three instances of > > the delimiting token, which is valid, but the former contains four, > > w

Re: sed question

2019-12-06 Thread songbird
Erik Christiansen wrote: ... > If the sed implementation of variable regexes proves problematic, then > there's awk with its Dynamic Regexps. (Section 2.8 of the pdf manual > floating about out there.) > > With its C-like syntax, it's less write-only than perl, perhaps because > it is of the same v

Re: sed question

2019-12-06 Thread Erik Christiansen
On 06.12.19 14:40, songbird wrote: > Greg Wooledge wrote: > ... > > Ideally, you'd just stop trying to use sed with user-supplied variables > > injected into the code. Sed was never built to be safe for that kind of > > work. > > sed was designed to operate on streams. a sequence of > charact

Re: sed question

2019-12-06 Thread songbird
Greg Wooledge wrote: ... > If you insist on doing #1, so be it. It's your damned computer, and your > damned problem. I can only warn you and be ignored so many times > before I give up and let your fuck yourself, as you so vehemently and > stubbornly eager to do. i appreciate the actual expla

Re: sed question

2019-12-06 Thread songbird
The Wanderer wrote: >songbird wrote: ... >> sed was designed to operate on streams. a sequence of characters is >> a stream. i don't see any reason why putting the variable into the >> middle of that expression means anything different. > > Because sed doesn't see the variable; the variable is ha

Re: sed question

2019-12-06 Thread The Wanderer
On 2019-12-06 at 14:40, songbird wrote: > Greg Wooledge wrote: ... >> Ideally, you'd just stop trying to use sed with user-supplied >> variables injected into the code. Sed was never built to be safe >> for that kind of work. > > sed was designed to operate on streams. a sequence of characters

Re: sed question

2019-12-06 Thread Greg Wooledge
On Fri, Dec 06, 2019 at 02:40:49PM -0500, songbird wrote: > Greg Wooledge wrote: > ... > > Ideally, you'd just stop trying to use sed with user-supplied variables > > injected into the code. Sed was never built to be safe for that kind of > > work. > > sed was designed to operate on streams. a

Re: sed question

2019-12-06 Thread songbird
Greg Wooledge wrote: ... > Ideally, you'd just stop trying to use sed with user-supplied variables > injected into the code. Sed was never built to be safe for that kind of > work. sed was designed to operate on streams. a sequence of characters is a stream. i don't see any reason why putti

Re: sed question

2019-12-06 Thread Greg Wooledge
On Fri, Dec 06, 2019 at 12:06:10PM -0500, songbird wrote: > #this doesn't work... > old_summary=`echo "Previous glitches and inconsistencies were due to a > missing / at the end of the baseurl... ,.#*$+%*$&#+(*={_})"` > result=`echo "summary: \"\"" | sed -e "s/^summary: .*$/summary: > \"${old_s

Re: sed usage (was: automated editing of text files)

2011-09-17 Thread Bob Proulx
Tom Furie wrote: > Bob Proulx wrote: > > Using sed is a good tool for this but if you want to append then you > > should use the 'a' command. > > > > $ printf "one\ntwo\nthree\nfour\n" | sed '/two/a\ > > -> foo' > > one > > two > > -> foo > > three > > four > > This doesn't quite wo

Re: sed or awk: decode base64 string in passwd-like file

2011-07-01 Thread Denny Schierz
hi, Am Freitag, den 01.07.2011, 00:24 +0200 schrieb Javier Barroso: > perl -F: -a -ne ' $F1=`echo $F[1] | openssl base64 -d`; print join > (":",$F[0],$F1,@F[2 .. $#F])' file thanks, I try it :-) cu Denny signature.asc Description: This is a digitally signed message part

Re: sed or awk: decode base64 string in passwd-like file

2011-07-01 Thread Denny Schierz
hi, Am Freitag, den 01.07.2011, 00:03 +0200 schrieb Arno Schuring: > > echo e0NSWVBUfVUx= | openssl base64 -d > I certainly hope you're not expecting to recover the plaintext nope :-) They are still crypted, but readable for other Daemons, like Dovecot: If you do some like: echo e0NSWVBUfVUx=

Re: sed or awk: decode base64 string in passwd-like file

2011-06-30 Thread Javier Barroso
On Wed, Jun 29, 2011 at 4:42 PM, Denny Schierz wrote: > hi, > > I have a file with strings like: > > tes...@domain.foo:e0NSWVBUfVUx=:500:12002::/imap/spool/domain.foo/%1n/% > n:storage=50 > > I need to decode the second field (password field), with something like: > > echo e0NSWVBUfVUx= | openssl

Re: sed or awk: decode base64 string in passwd-like file

2011-06-30 Thread Arno Schuring
Denny Schierz (linuxm...@4lin.net on 2011-06-29 16:42 +0200): > I have a file with strings like: > > tes...@domain.foo:e0NSWVBUfVUx=:500:12002::/imap/spool/domain.foo/%1n/% > n:storage=50 > > I need to decode the second field (password field), with something > like: > > echo e0NSWVBUfVUx= | open

Re: sed or awk: decode base64 string in passwd-like file

2011-06-29 Thread Lorenzo Beretta
Il 29/06/2011 16:50, Denny Schierz ha scritto: hi, I have a file with strings like: tes...@domain.foo:e0NSWVBUfVUx=:500:12002::/imap/spool/domain.foo/%1n/% n:storage=50 I need to decode the second field (password field), with something like: echo e0NSWVBUfVUx= | openssl base64 -d How can I d

[OT] Re: sed with several lines, how?

2010-11-27 Thread Johannes Wiedersich
Arthur Bela wrote: > i just can't figure it out, how to "sed" when having several lines > [nor in awk, perl..] I have not really understood your question, but maybe this will help you: http://www.grymoire.com/Unix/Sed.html#uh-51 I would go someway along the lines of removing the newline at the e

Re: sed with several lines, how?

2010-11-27 Thread Arthur Bela
thank you, and sorry, if i had formulated wrong, but the "SOMETEXT#X" is a random STRING, like: $ cat testfile.txt alsjflsajfkljasdf asfklasjlkyxcvo kldfjlkasjdfasdf kasfjxcvklajdflas yxcvkjasafjads asdfjkldjlasj uiyxzckjhasfsd $ $ awk 'BEGIN {sawpattern=0} "^SOMETEXT, ^SOMETEXT" {if (($0 ~/S

Re: Sed or awk: remove a line from a file

2010-06-07 Thread Dotan Cohen
On 3 June 2010 03:33, Karl Vogel wrote: > > Here are some good pages on sed and awk one-liners: > >  http://www.catonmat.net/blog/sed-one-liners-explained-part-one/ >  Famous Sed One-Liners Explained, Part I: File Spacing, Numbering and >    Text Conversion and Substitution >  Wed, 8 Oct 2008 03:0

Re: Sed or awk: remove a line from a file

2010-06-03 Thread Karl Vogel
Here are some good pages on sed and awk one-liners: http://www.catonmat.net/blog/sed-one-liners-explained-part-one/ Famous Sed One-Liners Explained, Part I: File Spacing, Numbering and Text Conversion and Substitution Wed, 8 Oct 2008 03:00:00 -0400 http://www.catonmat.net/blog/sed-on

Re: Sed or awk: remove a line from a file

2010-06-02 Thread James Brown
Andrei Popescu wrote: > On Fri,28.May.10, 15:19:21, Dotan Cohen wrote: > > >> sed or awk. But I've been reading sed and awk tutorials for two hours >> and I cannot figure out how to remove line N from the file without >> creating a second file. If I'm already going through the hassle of >> creat

Re: Sed or awk: remove a line from a file

2010-05-28 Thread John A. Sullivan III
On Fri, 2010-05-28 at 17:38 +0200, Elimar Riesebieter wrote: > * John A. Sullivan III [100528 11:06 -0400] > > On Fri, 2010-05-28 at 15:52 +0200, Elimar Riesebieter wrote: > > > * John A. Sullivan III [100528 09:19 -0400] > > > > On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: > > > [...]

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Elimar Riesebieter
* John A. Sullivan III [100528 11:06 -0400] > On Fri, 2010-05-28 at 15:52 +0200, Elimar Riesebieter wrote: > > * John A. Sullivan III [100528 09:19 -0400] > > > On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: > > [...] > > > > > > > > Don't use sed nor awk... > > > > > > > > man ssh-key

Re: Sed or awk: remove a line from a file

2010-05-28 Thread John A. Sullivan III
On Fri, 2010-05-28 at 15:52 +0200, Elimar Riesebieter wrote: > * John A. Sullivan III [100528 09:19 -0400] > > On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: > [...] > > > > > > Don't use sed nor awk... > > > > > > man ssh-keygen say: > > > > > > -R hostname > > > Re

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Elimar Riesebieter
* John A. Sullivan III [100528 09:19 -0400] > On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: [...] > > > > Don't use sed nor awk... > > > > man ssh-keygen say: > > > > -R hostname > > Removes all keys belonging to hostname from a known_hosts > > file. This option i

Re: Sed or awk: remove a line from a file

2010-05-28 Thread John A. Sullivan III
On Fri, 2010-05-28 at 09:19 -0400, John A. Sullivan III wrote: > On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: > > Le 14757ième jour après Epoch, > > Dotan Cohen écrivait: > > > > > As I regularly format my test box, I often get stuck SSHing into it, like > > > this: > > > > > > $ ssh

Re: Sed or awk: remove a line from a file

2010-05-28 Thread John A. Sullivan III
On Fri, 2010-05-28 at 14:45 +0200, François TOURDE wrote: > Le 14757ième jour après Epoch, > Dotan Cohen écrivait: > > > As I regularly format my test box, I often get stuck SSHing into it, like > > this: > > > > $ ssh u...@domain > > @@@ >

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Erwan David
On Fri, May 28, 2010 at 02:19:21PM CEST, Dotan Cohen said: > As I regularly format my test box, I often get stuck SSHing into it, like > this: > > $ ssh u...@domain > @@@ > @WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ >

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Dotan Cohen
On 28 May 2010 15:45, François TOURDE wrote: > Don't use sed nor awk... > > man ssh-keygen say: > >     -R hostname >             Removes all keys belonging to hostname from a known_hosts file.   > This option is useful to delete hashed >             hosts (see the -H option above). > Thanks, I w

Re: Sed or awk: remove a line from a file

2010-05-28 Thread François TOURDE
Le 14757ième jour après Epoch, Dotan Cohen écrivait: > As I regularly format my test box, I often get stuck SSHing into it, like > this: > > $ ssh u...@domain > @@@ > @WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ >

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Dotan Cohen
On 28 May 2010 15:38, Tixy wrote: > The -i option edits files in place, so... > >    sed -i 44d ~/.ssh/known_hosts > Thanks, I was simply missing the -i option. My weekend starts in less than one hour, must be related. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- To UNSU

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Tixy
On Fri, 2010-05-28 at 15:19 +0300, Dotan Cohen wrote: > I'd like to just remove line 44 from > ~/.ssh/known_hosts. Easy to do in VIM, probably even easier to do in > sed or awk. The -i option edits files in place, so... sed -i 44d ~/.ssh/known_hosts -- Tixy () The ASCII R

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Dotan Cohen
On 28 May 2010 15:27, Andrei Popescu wrote: > On Fri,28.May.10, 15:19:21, Dotan Cohen wrote: > >> sed or awk. But I've been reading sed and awk tutorials for two hours >> and I cannot figure out how to remove line N from the file without >> creating a second file. If I'm already going through the

Re: Sed or awk: remove a line from a file

2010-05-28 Thread Andrei Popescu
On Fri,28.May.10, 15:19:21, Dotan Cohen wrote: > sed or awk. But I've been reading sed and awk tutorials for two hours > and I cannot figure out how to remove line N from the file without > creating a second file. If I'm already going through the hassle of > creating then moving a second file then

Re: sed: adding lines before/after/inside line groups

2010-01-13 Thread Eduardo M KALINOWSKI
On Qua, 13 Jan 2010, green wrote: My head is about to burst from trying to comprehend sed usage. Perhaps some kind individual(s) will help me lest my mental capacity by surpassed. I have a file that looks like this (please pardon the bad, fake lyrics): [snip] example I want to convert these to

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-10 Thread Johannes Wiedersich
Cameron Hutchison wrote: > You can combine these into a single sed invocation: > > set -i -e "/.gconf/d" -e "/.java/d" script s/set/sed/ ;-) Johannes -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.or

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-09 Thread Brian Wells
On Tue, 2009-06-09 at 20:09 -0700, Brian Wells wrote: [...] > You could have done > > sed -e "/.gconf/d" script | sed -e "/.java/d" >script > Oops. I forgot that this will try to read and write script at the same time. Won't work. But you can still link together many commands, so long as you

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-09 Thread Brian Wells
On Mon, 2009-06-08 at 22:14 -0400, Tony Baldwin wrote: > Spiro Harvey wrote: > >> Can anyone recommend a program/shell script/editor plugin etc, that > >> can take arbitrary text as input and quote it like email programs > >> quote emails with a preceding "> " character? > > > > > > awk '{print

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-09 Thread Boyd Stephen Smith Jr.
In <4a2dc587.60...@gmail.com>, Tony Baldwin wrote: >Why is it that with sed, stuff like >sed -e /searchterm/d >I have to do >sed -e /searchterm/d infile > outfile, >and can't just do sed -e /searchterm/d file, without having to generate >another file? Traditional sed is very simple. It doesn't "k

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-09 Thread Eduardo M KALINOWSKI
On Seg, 08 Jun 2009, Tony Baldwin wrote: I've been learning to use sed and awk and grep, etc., lately. I have a general question (probably more appropriate elsewhere, but I'm going to ask here anyway. Smack me later.). Bad, very bad. Why is it that with sed, stuff like sed -e /searchterm/d

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-08 Thread Cameron Hutchison
Tony Baldwin writes: >Why is it that with sed, stuff like >sed -e /searchterm/d >I have to do >sed -e /searchterm/d infile > outfile, >and can't just do sed -e /searchterm/d file, without having to generate >another file? GNU sed (which is what you are most likely running) has the -i option to

Re: sed/awk/fmt question hijacked from Re: Program for quoting text like in email?

2009-06-08 Thread Richard Hector
On Mon, 2009-06-08 at 22:14 -0400, Tony Baldwin wrote: > > I've been learning to use sed and awk and grep, etc., lately. > I have a general question (probably more appropriate elsewhere, but I'm > going to ask here anyway. Smack me later.). > > Why is it that with sed, stuff like > sed -e /sea

Re: sed :(

2009-03-05 Thread Emanoil Kotsev
Tzafrir Cohen wrote: > On Thu, Mar 05, 2009 at 12:28:45AM +0100, Emanoil Kotsev wrote: > >> I meant you can not compare echo with sed > > You're missing the point: it's not sed that expands things. > > Run 'set -x' in your shell and run those examples. You'll see the > command after the expanti

Re: sed :(

2009-03-05 Thread Chris Davies
Steve Kemp wrote: > Because you've got nested quotes. e.g. This fails: > sed -i "s/"bob"/"chris"/g" /tmp/blah IMO that's a bad example, because it's not clear that the quotes surrounding bob and chris are processed by the shell and therefore never seen by sed. It "seems" to work even though yo

Re: sed :(

2009-03-04 Thread Tzafrir Cohen
On Thu, Mar 05, 2009 at 12:28:45AM +0100, Emanoil Kotsev wrote: > I meant you can not compare echo with sed You're missing the point: it's not sed that expands things. Run 'set -x' in your shell and run those examples. You'll see the command after the expantion by the shell. (Use 'set +x' to s

Re: sed :(

2009-03-04 Thread Emanoil Kotsev
Tzafrir Cohen wrote: >> >> Oh, this is nonsense >> >> we would then use echo to do the job of sed, wouldn't we? > > Nither. We let $SHELL expand the command-line first. > > But if you want a more complex example with sed: > > sed -e "somano "with" a dog" /etc/passwd > sed -e "somano \"wit

Re: sed :(

2009-03-04 Thread Tzafrir Cohen
On Thu, Mar 05, 2009 at 12:04:32AM +0100, Emanoil Kotsev wrote: > Tzafrir Cohen wrote: > > > On Wed, Mar 04, 2009 at 06:21:18PM +0100, Johannes Wiedersich wrote: > >> josep wrote: > >> > why isn't it working? :( > >> > > >> > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat > >>

Re: sed :(

2009-03-04 Thread Emanoil Kotsev
Tzafrir Cohen wrote: > On Wed, Mar 04, 2009 at 06:21:18PM +0100, Johannes Wiedersich wrote: >> josep wrote: >> > why isn't it working? :( >> > >> > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat >> > /etc/hostname)/g" /etc/dhcp3/dhclient.conf >> >> your quotes don't match. (T

Re: sed :(

2009-03-04 Thread Steve Kemp
On Wed Mar 04, 2009 at 18:14:54 +0100, josep wrote: >why isn't it working? :( > >sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat >/etc/hostname)/g" /etc/dhcp3/dhclient.conf Because you've got nested quotes. e.g. This fails: sed -i "s/"bob"/"chris"/g" /tmp/blah

Re: sed :(

2009-03-04 Thread Tzafrir Cohen
On Wed, Mar 04, 2009 at 06:21:18PM +0100, Johannes Wiedersich wrote: > josep wrote: > > why isn't it working? :( > > > > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat > > /etc/hostname)/g" /etc/dhcp3/dhclient.conf > > your quotes don't match. (There are probably other issues

Re: sed :(

2009-03-04 Thread josep
wow ^ ^ Thanks for the quick replies :) > it works!

Re: sed :(

2009-03-04 Thread Sjors Gielen
josep schreef: why isn't it working? :( sed -i "s/#send host-name "andare.fugue.com ";/send host-name $(cat /etc/hostname)/g" /etc/dhcp3/dhclient.conf You're using quotes inside quotes. Try this: sed -i "s/#send host-name "\""andare.fugue.com"\"";/send host-name

Re: sed :(

2009-03-04 Thread Johannes Wiedersich
josep wrote: > why isn't it working? :( > > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat > /etc/hostname)/g" /etc/dhcp3/dhclient.conf your quotes don't match. (There are probably other issues as well.) -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with

Re: sed :(

2009-03-04 Thread Tzafrir Cohen
On Wed, Mar 04, 2009 at 06:14:54PM +0100, josep wrote: > why isn't it working? :( > > sed -i "s/#send host-name "andare.fugue.com";/send host-name $(cat > /etc/hostname)/g" /etc/dhcp3/dhclient.conf What is it supposed to do? What does it do in practice? -- Tzafrir Cohen | tzaf...@jabbe

Re: sed help please

2009-01-27 Thread Daniel Dalton
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 please

2009-01-27 Thread Teemu Likonen
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 t

Re: sed help please

2009-01-27 Thread Axel Freyn
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 > idea

Re: sed

2008-09-22 Thread Barclay, Daniel
michael wrote: > I've been struggling to get this to work but I think 'sed' should be > able to do it if I could just get some help with the correct > incantation... > > > given a file with many strings, include many of the form > www > > I wish each to be transformed to > some url or other

Re: sed

2008-09-18 Thread Tzafrir Cohen
On Fri, Sep 19, 2008 at 09:15:23AM +1000, Alex Samad wrote: > On Thu, Sep 18, 2008 at 01:53:18PM +, Tzafrir Cohen wrote: > > On Thu, Sep 18, 2008 at 02:29:29PM +0100, michael wrote: > > > I've been struggling to get this to work but I think 'sed' should be > > > able to do it if I could just ge

Re: sed

2008-09-18 Thread Alex Samad
On Thu, Sep 18, 2008 at 01:53:18PM +, Tzafrir Cohen wrote: > On Thu, Sep 18, 2008 at 02:29:29PM +0100, michael wrote: > > I've been struggling to get this to work but I think 'sed' should be > > able to do it if I could just get some help with the correct > > incantation... > > > > > > given

Re: sed

2008-09-18 Thread Tzafrir Cohen
On Thu, Sep 18, 2008 at 09:06:54AM -0500, Matt Zagrabelny wrote: > On Thu, 2008-09-18 at 14:29 +0100, michael wrote: > > I've been struggling to get this to work but I think 'sed' should be > > able to do it if I could just get some help with the correct > > incantation... > > > > > > given a fil

Re: sed

2008-09-18 Thread michael
On Thu, 2008-09-18 at 09:06 -0500, Matt Zagrabelny wrote: > On Thu, 2008-09-18 at 14:29 +0100, michael wrote: > > I've been struggling to get this to work but I think 'sed' should be > > able to do it if I could just get some help with the correct > > incantation... > > > > > > given a file with

Re: sed

2008-09-18 Thread Matt Zagrabelny
On Thu, 2008-09-18 at 14:29 +0100, michael wrote: > I've been struggling to get this to work but I think 'sed' should be > able to do it if I could just get some help with the correct > incantation... > > > given a file with many strings, include many of the form > www > > I wish each to be tr

Re: sed

2008-09-18 Thread michael
On Thu, 2008-09-18 at 13:53 +, Tzafrir Cohen wrote: > On Thu, Sep 18, 2008 at 02:29:29PM +0100, michael wrote: > > I've been struggling to get this to work but I think 'sed' should be > > able to do it if I could just get some help with the correct > > incantation... > > > > > > given a file

Re: sed

2008-09-18 Thread Tzafrir Cohen
On Thu, Sep 18, 2008 at 02:29:29PM +0100, michael wrote: > I've been struggling to get this to work but I think 'sed' should be > able to do it if I could just get some help with the correct > incantation... > > > given a file with many strings, include many of the form > www > > I wish each t

Re: sed -i turns link into file

2008-01-18 Thread Bob McGowan
Vincent Lefevre wrote: On 2008-01-18 02:54:12 +0100, Александър Л. Димитров wrote: I don't think it's a bug, but a feature. It's at least a documentation bug. The sed(1) man page says: -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplie

Re: sed -i turns link into file

2008-01-18 Thread Vincent Lefevre
On 2008-01-18 02:54:12 +0100, Александър Л. Димитров wrote: > I don't think it's a bug, but a feature. It's at least a documentation bug. The sed(1) man page says: -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplied) I'd say that if it's

Re: sed -i turns link into file

2008-01-17 Thread Александър Л . Димитров
Quoth Jonathan Wilson: > On Thursday 17 January 2008 10:48:41 Johannes Wiedersich wrote: > > I encountered something rather odd and in my eyes disturbing: if I edit > > a symlinked file with an ordinary editor (nano, kate, ...) the editor > > edits the file instead and leaves the symlink intact. >

Re: sed -i turns link into file

2008-01-17 Thread Jonathan Wilson
On Thursday 17 January 2008 10:48:41 Johannes Wiedersich wrote: > I encountered something rather odd and in my eyes disturbing: if I edit > a symlinked file with an ordinary editor (nano, kate, ...) the editor > edits the file instead and leaves the symlink intact. I Tried this on SuSE and it beh

Re: sed -i turns link into file

2008-01-17 Thread Rick Pasotto
On Thu, Jan 17, 2008 at 05:48:41PM +0100, Johannes Wiedersich wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I encountered something rather odd and in my eyes disturbing: if I edit > a symlinked file with an ordinary editor (nano, kate, ...) the editor > edits the file instead and le

Re: Sed advice needed

2007-06-23 Thread Jude DaShiell
There is a mailing list for sed [EMAIL PROTECTED] for those interested in keeping tabs on this editor and exchanging tips. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-06-10 Thread Douglas Allan Tutty
On Sun, Jun 10, 2007 at 08:36:13PM -0400, Nick Lidakis wrote: > Douglas Allan Tutty wrote: > >On Wed, May 30, 2007 at 01:50:00PM -0400, Nick Lidakis wrote: > >>Joey Hess wrote: > Any ideas? I am not even allowed to move or delete the file via the > shell. > > >>>You have a cor

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-06-10 Thread Nick Lidakis
Douglas Allan Tutty wrote: On Wed, May 30, 2007 at 01:50:00PM -0400, Nick Lidakis wrote: Joey Hess wrote: Any ideas? I am not even allowed to move or delete the file via the shell. You have a corrupted filesystem. Suggest going to single user mode and fscking. Th

Re: Sed advice needed

2007-05-31 Thread Tyler MacDonald
Piers Kittel <[EMAIL PROTECTED]> wrote: > "181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark" > "185","1324.078941","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, SSRC=2008229573, S

Re: Sed advice needed

2007-05-31 Thread Allan Wind
On 2007-05-31T17:05:04+0100, Piers Kittel wrote: > I need to delete some words out of a large file containing > information about packets I'm analysing. I know I can use sed to do > this, but haven't really used it before, so am a bit unsure of how to > do it. Two example lines are as of be

Re: Sed advice needed

2007-05-31 Thread Ron Johnson
On 05/31/07 11:05, Piers Kittel wrote: Hello all, I need to delete some words out of a large file containing information about packets I'm analysing. I know I can use sed to do this, but haven't really used it before, so am a bit unsure of how to do it. Two example lines are as of below:

Re: Sed advice needed

2007-05-31 Thread Tyler Smith
On 2007-05-31, Piers Kittel <[EMAIL PROTECTED]> wrote: > > "181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark" > "185","1324.078941","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, S

Re: Sed advice needed

2007-05-31 Thread Bob McGowan
Piers Kittel wrote: Hello all, I need to delete some words out of a large file containing information about packets I'm analysing. I know I can use sed to do this, but haven't really used it before, so am a bit unsure of how to do it. Two example lines are as of below: "181","1324.014027"

Re: Sed advice needed

2007-05-31 Thread Andre Majorel
On 2007-05-31 17:05 +0100, Piers Kittel wrote: > "181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark" > "185","1324.078941","111.111.111.111","111.111.111.111","RTP","Payload t > ype=ITU-T H.261, SSRC=20082

Re: Sed advice needed

2007-05-31 Thread Piers Kittel
On 31 May 2007, at 17:49, Tyler MacDonald wrote: Piers Kittel <[EMAIL PROTECTED]> wrote: "181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payloa d t ype=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark" "185","1324.078941","111.111.111.111","111.111.111.111","RTP",

Re: Sed advice needed

2007-05-31 Thread Larry Irwin
Here's one way: # Put the sample lines into a file called inline.txt for inline in `cat inline.txt | tr -d " "` #remove spaces for cut do # Remove quotes Tmp=`echo $inline | tr -d "\""` # Break into fields... f1=`echo $Tmp | cut -f1 -d","` f2=`echo $Tmp | cut -f2 -d","` f3=`echo $Tmp | cut

Re: Sed advice needed

2007-05-31 Thread Georg Heinrich
Piers Kittel ([EMAIL PROTECTED]) wrote on Thu, 31 May 2007 17:05:04 +0100: >What's the best way to do this? I've been reading the man pages of >sed, cut and awk but I can't quite figure out how to do this. Any >ideas? The sed man page is not very helpful I'm afraid. A pretty good manual is

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-30 Thread Douglas Allan Tutty
On Wed, May 30, 2007 at 01:50:00PM -0400, Nick Lidakis wrote: > Joey Hess wrote: > >>Any ideas? I am not even allowed to move or delete the file via the shell. > > > >You have a corrupted filesystem. Suggest going to single user mode and > >fscking. > > > Thanks. That did the trick. Even though

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-30 Thread Nick Lidakis
Joey Hess wrote: nick lidakis wrote: I'm having trouble upgrading my Debian Sid laptop after attempting dselect install. Dselect quits with this error: Preparing to replace sed 4.1.5-1 (using .../archives/sed_4.1.5-2_i386.deb) ... Unpacking replacement sed ... dpkg: error processing /var/

Re: [OT] Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-24 Thread Michelle Konzack
Am 2007-05-22 10:47:15, schrieb Nyizsnyik Ferenc: > On Mon, 21 May 2007 16:57:52 -0400 > nick lidakis <[EMAIL PROTECTED]> wrote: > > thinkpad:/usr/share/locale/ca/LC_MESSAGES# ls -alt sed.mo > > c---rwxrwx 5389 2484475149 353247318 247, 62 Dec 31 1969 sed.mo > > So sed is one of the oldest Unix c

Re: [OT] Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-22 Thread Mathias Brodala
Hi. Nyizsnyik Ferenc, 22.05.2007 10:47: > On Mon, 21 May 2007 16:57:52 -0400 > nick lidakis <[EMAIL PROTECTED]> wrote: >> Also, the file sed.mo has a date of 1969. ls -alt sed.mo reveals: >> >> thinkpad:/usr/share/locale/ca/LC_MESSAGES# ls -alt sed.mo >> c---rwxrwx 5389 2484475149 353247318 247, 6

[OT] Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-22 Thread Nyizsnyik Ferenc
On Mon, 21 May 2007 16:57:52 -0400 nick lidakis <[EMAIL PROTECTED]> wrote: > I'm having trouble upgrading my Debian Sid laptop after attempting > dselect install. Dselect quits with this error: > > Preparing to replace sed 4.1.5-1 (using > /archives/sed_4.1.5-2_i386.deb) ... > Unpacking rep

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-21 Thread Brad Sawatzky
On Mon, 21 May 2007, nick lidakis wrote: > I'm having trouble upgrading my Debian Sid laptop after attempting > dselect install. Dselect quits with this error: > > Preparing to replace sed 4.1.5-1 (using > .../archives/sed_4.1.5-2_i386.deb) ... > Unpacking replacement sed ... > dpkg: error proc

Re: sed fails to upgrade on debian sid; file date of 1969?

2007-05-21 Thread Joey Hess
nick lidakis wrote: > I'm having trouble upgrading my Debian Sid laptop after attempting > dselect install. Dselect quits with this error: > > Preparing to replace sed 4.1.5-1 (using > .../archives/sed_4.1.5-2_i386.deb) ... > Unpacking replacement sed ... > dpkg: error processing /var/cache/apt/

Re: sed command spanning multiple lines

2007-04-11 Thread Andrew Sackville-West
On Wed, Apr 11, 2007 at 12:22:16PM -0500, Russell L. Harris wrote: > Is it possible to spread a sed command over multiple lines, to improve > readability (for the sake of future maintenance)? If so, what > character is used to break the line and what are the rules? > > For example, I would like t

Re: sed command spanning multiple lines

2007-04-11 Thread Cédric Lucantis
> > sed -e 's/\.//g' > -e 's/\,//g' > -e 's/\\//g' "$1" ... but also note that this can be done with a single command (escaping is useless here) : 's/[,/.]//g' -- Cédric Lucantis

Re: sed command spanning multiple lines

2007-04-11 Thread Cédric Lucantis
Le mercredi 11 avril 2007 19:22, Russell L. Harris a écrit : > Is it possible to spread a sed command over multiple lines, to improve > readability (for the sake of future maintenance)? If so, what > character is used to break the line and what are the rules? > > For example, I would like to re-wr

  1   2   >