@# Quotes DB     useful, funny, interesting





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



Comments:

<0> trash: kanaldrache thanks. Didn't realize you could do that.
<1> sorry for delay, here it is: http://pastebin.ca/69138
<2> themoves: your example was right; your code isn't.
<2> for i in "foo bar" "baz"; do echo "$i"; done
<2> !quotes
<3> USE MORE QUOTES! http://www.grymoire.com/Unix/Quote.html
<4> USE MORE BONSAI!
<4> er...
<5> Free green stamps!
<2> TheBonsai: you've watched way too much Karate Kid. 8)
<1> got it now, it was mv that was exploding the string. I just quoted that. Thanks all
<4> heh trash, flippo :)
<6> how would I switch two lines with bash?
<7> ed(1) might be helpful.
<6> thanks
<6> greycat: is there a way to search for a particular word in a txt file and witch that word with another word? say I want to switch word1 with word2



<8> sed
<4> sed 's/foo/bar/g'
<8> be aware that you want to be very specific so you dont change things you werent expecting
<9> How can I in (busybox/ash actually, but anyway..) use wait and & to allways run X instances of a program in bg?
<9> i am doing this allmost: for file in torrents/* ; do ctorrent -s download/`basename "$file" .torrent` $file >/dev/null 2>&1 ; done
<9> only problem is I dont want to run more than two instances of ctorrent at any time.. so I probably have to use some counter and wait. How should I approach this?
<9> 2>&1 & :)
<10> hi
<11> set -- $(pidof ctorrent);echo $# gives you the number of ctorrent processes
<10> there's a command somewhere, don't remember what, so I can do 'for i in 1 through 5' instead of doing 'for i in 1 2 3 4 5'. what's this?
<7> for ((i=1; i<=5; i++)); do ...
<9> seq
<10> kanaldrache: is $() synonymous to ``?
<7> or in bash3: for i in {1..5}
<10> ah. seq...
<7> !`
<3> The backquote (`) is used in the old-style command substitution, e.g. foo=`command`. This syntax is deprecated in favor of foo=$(command). Backslash handling inside $() is less surprising, and $() is easier to nest.
<7> no, NOT seq.
<7> ****ing seq.
<8> for i in {1..5}, for i in $(seq 1 5), for ((i=1; i<=5; i++));
<9> nice for -e
<9> -w
<7> the *worst* ever answer to that question.
<10> what's wrong with seq?
<7> "Yes, let's not only spawn an EXTERNAL process to count to 5 for us, but let's use one that doesn't EXIST on most platforms!!!"
<10> :)
<10> ok
<7> imadev:~$ seq 1 5
<7> bash: seq: command not found
<10> get the point
<9> seq is everywhere
<9> but I know grey
<7> bull****.
<8> you can also do while [ i < 5]
<7> _sho_: no.
<9> greybot, got an answer to my prev question too?
<8> greycat, not that format, but you can do it with while
<7> !math
<3> http://wooledge.org/mywiki/ArithmeticExpression
<7> i=1; while ((i < 5))
<8> nod
<7> or the legacy version: while [ i -lt 5 ]
<10> i=0; while ((i++ < 5=))
<10> will that work?
<7> what the hell is 5= ?
<10> 42!
<10> i'll use for. that looks almost c-ish
<7> tziOm: if you wanted the job-scheduler: no, sorry, we don't have canned answers for job scheduling software.
<9> greycat, but could it be done?
<8> in perl!
<9> got no perl in 2 megs of flash
<7> if you're willing to waste CPU cycles, you could poll the list of PIDs every X seconds and see which ones are still alive...
<9> what I would want is PIDARRAY = wait $PID|$PID
<7> though I'd almost certainly want to use an array for that, instead of whatever string manipulations ash has.
<12> ugh i hate it how this book seems to repeat itself every five pages, ive read about how abstract subcl***efiers are a bad idea about a gazillion times by now
<9> greycat, so I cant use wait anyway.. no..
<7> no, you can't.
<9> greybot, any simple test to see if a PID is running?
<7> kill -0
<9> greycat, any wiki on using arrays in bash?
<9> !arrays



<11> tziOm: You really have to check every few secnds if the processes are running, that's neither hard nor too unefficient
<9> kanaldrache, thats what im going to
<11> tziOm: You don't need arrays for saving to pids
<9> kanaldrache, howto save them?
<11> s/to/two/
<7> or... the easy way out, you could just split the list in two, and run two background instances, each of which just processes its half of the list sequentially.
<11> In a var? Positional paramaters? As you like
<7> kanaldrache: an array would make it easier to DELETE the pid once it's finished.
<11> That's right
<11> Althought " ${pids%* $pid } ${pids% *$pid } " isn't to hard
<9> what should I place inside the alive sub?
<9> ..function..
<7> why are you asking people to write your entire application?
<9> greycat, Because Im not so good with programming except simple tasks..
<9> and now Im basically stuck on the arrays part.. rest I can do
<7> *does* your shell have arrays?
<11> tziOm: So take the man page or (if you are using) abs and read the specific parts
<11> We give you all the hints you need to solve that relativly simple problem
<9> dont have man-pages on a 2Mb flash :(
<7> you idiot.
<7> read the man pages ON YOUR REAL COMPUTER.
<9> dont have ash/busybox there.
<11> You can even read them online
<7> FIX THAT!
<8> look. if you cant program, why would you try so hard to fit something into a flash card
<11> tziOm: Believe us, development on the local system is so much better!
<8> are you trying to make a kickstart? theres dozens already available written by competent people
<9> I can hack it to work.. Would just be nice to see how guys that knew would do it..
<9> I would use cut -f -d ..
<6> greycat: btw, scripts that use seq are very stupid imho
<11> tziOm: Right it then and post it ... somebody will comment it
<7> we'd use a language that has arrays, like bash. unset a[4]
<7> voila, no more element 4 in the array.
<6> greycat: seq -w 0 100 | awk '{print "http://www.foo.com/images/blah"$1".jpg";}'
<6> greycat: I'd appreciate an equivalent without seq
<6> someone told me about 'apply' on FreeBSD
<6> but I forgot it :(
<13> Listeg: it's possible with awk
<8> you just pop into channel?
<6> I ended up installing seq2 from BSD ports to do that
<7> for ((i=0; i<=100; i++)); do printf "http://www.pr0ns1te.com/images/hotbabe%03d.jpg"; $i; done
<7> no seq, no awk, nothing but builtins.
<8> for i in {0..100}, while ((i<100))
<8> greycat, wow. great taste in ladies
<8> i approve
<6> greycat: Okay, bash internals?
<13> unset i; while ((i<100)); do printf "http://www.pr0ns1te.com/images/hotbabe%03d.jpg"; $((i++)); done
<7> printf is a builtin, yes.
<6> ok, just added a \n ;)
<13> right
<13> forgot \n
<8> who needs new lines
<8> rofl@gc
<8> i should write a really hard core porn snatcher in bash
<7> he's hardly the *first* person to come here wondering how to pull all the sequentially numbers, zero-padded images from a pr0n site.
<8> then i can distribute it to all the peep here
<6> greycat: how would you skip the leading 0? like 0,1,2,3 instead of 001,002,003
<2> lol
<7> %d instead of %03d
<7> of course, then you can leave out the printf as well. just concatenate it.
<6> the beauty of terminal
<6> =)
<7> what's that got to do with terminals?
<6> I meant the command line
<6> no fancy interface to do that
<6> its hard to do that with a gui
<6> unless there is a kde-porn-image-downloadmanager ;) hehe
<2> there is porn-get
<2> check http://lesbian.mine.nu ;)
<13> yuck
<6> trash, isnt that a commandline util ?
<6> Clearly porn-get doesn't use kde -- there's no k.
<13> there ist libpr0n


Name:

Comments:

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






Return to #bash
or
Go to some related logs:

jron monitor
#kde
mysql multiple replace
sqlite check existence of a column
#fedora
#perl
error texture ppracer
my.cnf two databases
/TOPIC topicsmite
#php



Home  |  disclaimer  |  contact  |  submit quotes