@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10



Comments:

<0> quit
<1> echo -e "toto1\ntoto2" | (read t1 ; read t2)
<1> don't work :(
<1> do you understant what I want
<2> aurel_: faq 24 could describe the cause
<2> !faq disappear.*loop
<3> heiner_: 24. I set variables in a loop. Why do they suddenly disappear after the loop terminates?
<4> No matches found at http://wooledge.org/mywiki/BashFaq
<3> heiner_: http://shelldorado.dyndns.org/wiki/index.php/BashFaq#faq24
<1> yes thanks for all, it was not so easy I think before ...
<5> [[ false || false ]] && echo yep that does not work with return values of commands obviously
<6> [[ false ]] does not do what you think it does.
<5> greycat: yeah, seems to
<6> seems to what?
<5> it's no expression
<7> greycat: what should one use instead?



<6> eddyt: to achieve what goal?
<7> in this context (I came late)
<6> I don't see any context in either /lastlog eddyt or in /lastlog calmar
<6> imadev:~$ [[ yabba-dabba-doo ]] && echo true
<6> true
<6> imadev:~$ [[ false ]] && echo true
<6> true
<6> it's true because f-a-l-s-e is a non-zero-length string.
<7> oh ok
<7> sorry, my bad.
<5> greycat: I see. thanks
<8> VIm_Enforcer: Use a pastebin.
<9> goldfish: ?
<9> awk?
<7> how would I access 32 files an delete the 42nd line in each file
<8> yes.
<9> k, k
<8> eddyt: sed
<9> next time
<8> VIm_Enforcer: Sort out your problem?
<9> goldfish: yes, i have
<8> sed '42d'
<8> VIm_Enforcer: cool.
<10> goldfish: sed is stream editor
<6> with a temp file, and mv, and &&
<10> goldfish: not file editor
<6> in a for loop
<10> what about ed?
<8> ml2: yeah?
<6> ed might work.
<9> eddyt: find -exec sed
<8> sed -i , or mv and &&
<8> or ed...
<6> s/sed/gsed4/
<8> :)
<11> y0
<9> TheBonsai!
<7> umm, ok
<7> thanks
<5> if false || true; then ...; fi seems to work so :) thx again
<9> calmar: um
<9> that looks liek obfuscated code to me :)
<10> echo -e '42d\nwq' | ed -s files...
<10> echo -e '42d\nwq' | ed -s file
<7> me?
<11> calmar: "The return status of AND and OR lists is the exit status of the last command executed in the list." --> it MUST work
<8> eddyt: yes.
<10> eddyt: for every file
<9> goldfish: tell me why he can't just find -exec sed ...
<8> He can.
<8> ml2 just prefers using ed :)
<10> -exec sh -c 'echo -e 42d\\nwq | ed -s "$0"' {} \;
<9> goldfish: :
<9> )
<10> because ed is for files, sed is for streams
<9> yea
<6> ed is the standard editor!
<8> VIm_Enforcer: You are dealing with hardcore UNIX users here.
<7> ml2.. I think that would do it
<5> TheBonsai: ,yeah, I mean the false and true statements are just representatives for my pgrep's actually



<8> Not GNU fanboys.
<9> goldfish: :)
<10> following would work, too: yes 42d$'\n'wq | find ... -exec ed -s {} \;
<11> GNU fanboys
<11> haha
<9> :P
<6> !learn ed http://www.gnu.org/fun/jokes/ed.msg.html
<4> OK, greycat
<9> !learn
<4> usage: !learn key value...
<11> VIm_Enforcer: our generation probably is the same.
<9> TheBonsai: bet?
<11> VIm_Enforcer: it was a guess. YoB?
<7> printf "1\n2\n3\n4\n5\n" | sed '3d'
<7> deletes the 3rd line
<7> I need to figure out how to delete the 42nd
<6> and writes it to stdout.
<6> 42d
<9> eddyt: >.>
<9> eddyt: 42d
<8> eddyt: ml2 just showed you.
<9> eddyt: www.flashdance.cx/books/unix/sedawk/index.htm
<9> ;)
<7> ml2 why use ed when sed could do it easier?
<9> goldfish: sed is unix, too :)
<6> because you HAVE NOT YET SEEN the sed answer.
<10> ed deletes lines from files, sed deletes lines from the stream
<6> it's NOT easier.
<11> because sed wasn't made to edit files. it copies your file and makes a new one under the same name. you might or might not want that behaviour
<10> you asked to delete a line of a file
<6> no, it writes the new data to stdout.
<11> (talking of GNU sed -i option)
<10> _file_
<6> TheBonsai: oh, that's cheating.
<8> VIm_Enforcer: GNU sed isn't.
<11> yea :)
<9> goldfish: i couldn't tell :P
<6> gsed4 has a -i option. sed doesn't.
<11> VIm_Enforcer: GNU sed's -i does NOT edit the file.
<9> greycat: ha, you unignored me?
<9> :P
<10> ed is standard editor
<10> ed should always work
<9> TheBonsai: i know, i know
<9> but you can redir the output
<9> to a new file
<8> Don't have a hissy fit ladies!
<6> anything that 'edits' a file has to write to a temp file and then move it over top of the original. or make a backup of the original and then overwrite it. there's no other way.
<9> or make a function/script to do that automatically (like me)
<9> :P
<6> unless all you're doing is truncating a file to a specified byte size. that could be done without temp files.
<10> or just use a real editor
<9> greycat: you mean buffer
<9> write to a buffer and then overwrite
<6> ml2: a real editor WILL MAKE A BACKUP COPY OR IT WILL MAKE A TEMP FILE. IT IS **NOT** **POSSIBLE** TO DO IT WITHOUT DOING ONE OF THOSE TWO THINGS.
<6> it just hides the details from you.
<8> Emacs has been replaced by a shell script which 1) Generates a syslog
<8> message at level LOG_EMERG; 2) reduces the user's disk quota by 100K;
<8> and 3) RUNS ED!!!!!!
<8> LOL.
<10> greycat: That is what I want. A tool that just does it
<6> ml2: ed, gsed4, perl5
<9> goldfish: rolf
<9> rflo
<9> rofl*
<6> one of those should suit you.
<10> sed is for streams
<10> stream editor
<6> I did not list sed among the choices.
<6> do you see "sed" there? no. you do not. you see "gsed4".
<9> greycat: sed is a regex


Name:

Comments:

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






Return to #bash
or
Go to some related logs:

#linux
ubuntu hypertrm
#php
GM9xx
conky disappear xgl
wrk54g rescue
#gentoo
syslog-ng won't listen on udp
firestarter autostart ubuntu
#qemu



Home  |  disclaimer  |  contact  |  submit quotes