@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> sed -e :begin -e 'N;$!b begin' -e 's/sd/XY/g'
<1> hey
<1> i've got this expression but it doesn't seem to be doing the trick:
<1> sed -n '/^-- Host: .*Database: sparshatts/,/^-- Host: .*Database: stockroom/p' dump.sql > newdump.sql
<1> i'm trying to split up a mysql database dump into seperate files
<1> well, to get one database out of the whole file
<2> Edward123: sed printing too much or too little?
<1> it's outputting an empty file but is returning no errors
<2> Edward123: try this first: sed -n '/^-- Host: .*Database: sparshatts/,/^-- Host: .*Database: stockroom/p' dump.sql
<2> Edward123: see if that creates output
<2> Edward123: if it does create output try: sed -n '/^-- Host: .*Database: sparshatts/,/^-- Host: .*Database: stockroom/p' dump.sql >> newdump.sql #not the >>



<2> note the >>
<1> okay chief i'll give it a spin
<2> jokay ;)
<1> it didn't seem to work, i ended up cutting up the bastard in a text editor
<3> hi all
<3> i have a text file the one i would like to append a new line at the eof, currenlty i am tring to use cat file | sed 'a\new line' but is not working
<3> any idea on how to do this
<4> printf "\n" >> file
<4> if i understand you correctly
<4> append a blank line to a file?
<3> i would like to apeend this: ##vim:ft=apache
<4> just use >>
<4> with echo, or printf
<3> i was planing to use perl -pi -e 'something' *
<4> i see.
<3> so all files under that dir could have that line
<4> So, what you really want to do, is add ##vim:ft=apache to the end of all files in your directory?
<3> right
<3> to all virtualhost files under apache dir for been more specific
<4> I see.
<4> and how can you detect a virtualhost file?
<3> i have about more thant 50 files the ones i would like to add at the end of the file the line #vim:ft=apache
<3> right
<3> some times i use perl -pi -e 's/domainname/otherdomain/' *
<3> and that works for all the files
<4> yep
<3> something similar i would like touse but for adding a line at eof
<4> well like, are all the files in the directory virtualhost files?
<4> is what i'm asking
<3> yes
<3> all files there are virtualhost files
<4> cd /your/apache/directory/
<4> for i in ./*; do echo "##vim:ft=apache" >> "$i"; done
<3> :) that works perfect but is just that i would like to know if sed can do the same
<4> eh yeah
<4> Can't remember how to match the final line
<3> i was using ^$ or $ but that is only end of line not of file
<5> hm
<5> sed '$a\new line'
<5> and you're done
<5> :)
<3> when trying to do that i get this: sed$a\new line: Command not found.
<5> ...



<5> Then you are doing it wrong.
<3> cat a | sed'$a\new line'
<5> JESUS
<5> Obviously
<5> ;)
<5> Read what I execute
<4> sed '$a\new line' file
<5> Read what you execute
<5> and find one difference
<4> no need for the cat killing
<3> > cat a | sed '$a\new line'
<3> sed: 1: "$a\new line": extra characters after \ at the end of a command
<5> OS?
<5> sed --version
<3> FreeBSd 6.1
<5> ah
<5> sed '$a foobar'
<5> try that
<3> > cat a | sed '$a foobar'
<3> sed: 1: "$a foobar": command a expects \ followed by text
<5> hm
<5> sed '$a\
<5> foobar'
<3> > cat a | sed '$a\
<3> ? foobar'
<3> sed: 1: "$a
<3> foobar": command a expects \ followed by text
<5> uno momento, bela signorina
<3> how can i see the version of sed
<3> ok thanks
<5> My method _does_ work
<5> Type this:
<5> echo "foobar" | sed '$a\[now press enter]
<5> text'
<5> (again press enter)
<3> that is what i did
<5> Obviously, it isn't
<3> maybe this has to ve with freebsd/sed
<5> I did try it in freebsd sed
<3> and worked ?
<5> Yes.
<3> what did you did hor how did you use it ?
<3> i am doing cat file | sed '$a\[enter]
<3> text'
<3> enter
<3> and did not work
<0> <file sed -e '$a\
<0> [enter]'


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #sed
or
Go to some related logs:

#fedora
#kde
#lisp
#php
ubuntu apt-get build-deps source package
#oe
movw syntax ARM
#mysql
MesaGL INDIRECT
gentoo xmkmf: command not found



Home  |  disclaimer  |  contact  |  submit quotes