@# Quotes DB     useful, funny, interesting





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



Comments:

<0> spawn et-etpro
<0> expect "is:"
<0> send reconnect
<0> when it sees "is:"
<0> then enemy-territory just dies
<0> no errors, no nothing
<1> it wont expect anything on the terminal maybe
<0> i don't quite follow you
<0> it recognizes the expect part
<1> same, i think the output it expects is way bigger than "is:" - maybe it wont stop on or does stop on the first line
<0> and when it does then it just dies
<0> now i added another expect after the is:
<0> so it waits for that one also
<0> but it never occurs
<0> so the whole thing lives
<2> hi guys. can anyone help me make http://pastebin.com/851861 cleaner, rather than using all the if's?



<3> [ -z "${wPRODUCT}" ] && PATTERN="${PATTERN}\*-"
<3> for example
<4> woland_: read up on parameter expansion.
<2> ITSME34: where is the else handled?
<3> ||
<3> [ this ] && that || something_else
<2> trash: could you give me an example of what i'm looking for?
<4> ${parameter:-word}
<4> Use Default Values. If parameter is unset or null, the
<4> expansion of word is substituted. Otherwise, the value of
<4> parameter is substituted.
<2> so ${wPRODUCT:-'\*'} .. but then how to p*** the ***ignment of wPRODUCT as well as the (\*|${wPRODUCT})?
<2> see what i mean?
<5> Nope.
<2> I can use ${var:-} to set pattern to \* if var isn't set. thats great, but if it is set i'd like to set pattern to (\*|${var})
<5> You mean a literal left paren, backslash, asterisk, pipe, dollar sign, left brace, var, right brace, right paren?
<5> If so, just single quote that whole mess.
<6> i have a list of paths, ie /path/to/FOO (they all end in FOO) but they are in different lefels i.e i can have /path/FOO how can i get, the path without FOO
<6> err levels
<5> dirname "$foo"
<6> woohoo
<6> thanks greycat
<2> greycat: sorry, could you elaborate please?
<5> woland_: foo='#@*#*^!#@*&(#&%()'
<5> whatever that crap is that you wanted.
<7> its le crap
<7> im franch you knew
<8> oy
<7> vey
<8> ...board
<8> veyboard is a 1337 keyboard
<7> bored?
<8> wiki it
<7> wiki it good?
<2> greycat: when i said set pattern to (\*|${var}) i meant pattern="${pattern}(\*|${var})" .. like on the pastebin
<5> except that, if var is unset, you want XYZ there instead of nothing?
<5> pattern="${pattern}(\*|${var:-XYZ})"
<2> greycat: that will leave me with \*|. i dont want the pipe
<2> and the brackets are useless too, if var is unset
<5> Y'see, I'm getting little glimpses of pieces of what you want.
<5> You want X, sort of. But no, you want Y, maybe. And you want to check for Z. But I don't know what you want to DO if Z is true.
<2> did you read the pastebin?
<5> no, of course not.
<5> I never read random URLs from people who can't explain what they want in simple English.
<2> i want to set pattern to '^*-*-*-*' if no variables are set
<2> if variables are set, i'd like to set pattern to '^(*|var1)-(*|var2)-(*|var3)-(*|var4)'
<2> or if just var1 was set.. '^(*|var1)-*-*-*'
<5> x1="(*|$var1)" x2="(*|$var2)" x3="(*|$var3)" x4="(*|$var4) x5="(*|$var5)"
<5> oh wait... no....
<5> This makes my brain hurt.
<5> I don't think there's any elegant way to do it.
<5> unset x1 x2 x3 x4 x5; [[ $var1 ]] && x1="(*|$var1)"; ....
<5> pattern="^${x1:-\*}- ..."
<2> at the moment i have lots of if's, which's ugly as hell
<5> ***uming you need a \ there... you might not. I'd have to test to find out, and I don't feel like it.
<2> the \* remains from when i was looping through rather than using grep
<9> Is there a way to find all lines in a file that are greater than X characters long
<5> awk '{if (length($0) > x) print}' or something.
<9> How would I make it so that it prints the file and line number? I don't know awk.
<5> man awk, /j #awk, ...



<6> ok, another (hopefully) quick question, now i have a list of things that contain chars like <,>,= how can i remove those characters and those to the right until a space
<8> hacosta_ sed
<8> sed 's/[<>=].* / /g'
<8> imo
<6> VImtermute: thanks, will check
<6> thanks a lot
<2> thanks for the help greycat. looks a lot nicer now
<8> hacosta_ works?
<6> yup
<8> hacosta_ np then :)
<6> thanks
<8> ;)
<6> btw, how do i know if i should use sed or awk?
<5> experience
<8> um, awk is more field oriented, i'd say
<6> not that it would matter as i **** at sed, and scared of awk
<5> some problems are sed-type problems, and some are awk-type problems.
<8> and sed is an inline editor
<5> and some are neither.
<8> both complement the other
<8> :)
<6> goof.
<6> ohh
<6> good
<10> hacosta_: awk is more field oriented than sed.
<1> oh no mp3 format is nice tho
<10> hacosta_: In addition to working better with moderately structured data, it's less cryptic. Having said that, sed is faster at what it does.
<5> if your problem looks vaguely like "I want to change all foo into bar" then it's a sed-type. If it looks like "I want to add up the 5th field of every line and print the total", then it's awk-type.
<10> hacosta_: Ie: awk works better with moderately structured data.
<11> hi, is stdout a real pipe ?
<11> i.e. does it have the same restrictions (its size) as a pipe i can design myself ?
<12> stdout is an fd, not a pipe
<5> it's a file descriptor. it may be ***igned to a file, or to a pipe.
<5> I can't even parse your second question.
<11> :)
<12> I ***ume he just meant to say file descriptor instead of pipe.
<5> I'd never ***ume such a thing.
<8> ok
<11> greycat is right
<8> and no, if you launch an asynchronous cmd, you don't have to wait
<8> unless you use the wait builtin
<11> i redirect stout of a binary to a pipe, however on my system a pipe is max 256bytes - and so my read from this pipe is max 256
<13> an asynchronous cmd means background?
<8> yes
<5> sb9: you're not making any sense whatsoever.
<5> show us precisely what command you ran. and if you're not on a standard Unix-type system, tell us what system it is.
<13> so should i launch program, write pid file, wait, remove pid file?
<5> hagabaka: why do you need it in a file?
<8> something like that
<6> pidof
<13> i'm using it to ensure that only one process of the program is run by the script
<8> but, if you don't intend to include the PID in the name of the lockfile, it's pretty unnecessary to run bg jobs
<13> well actually maybe i can do with just one instance of the program run by my user
<5> !faq mutual
<14> http://wooledge.org/mywiki/BashFaq#faq45 -- How can I ensure that only one instance of a script is running at a time (mutual exclusion)?
<13> hmm
<11> ok greycat youre right i will first take a look at the code before asking
<15> the curly brackets in the following command refer to the results of the find command?
<15> find path/to/find -exec cp -p {} path/to/copy
<8> yea
<15> is this cleaner than piping?
<5> yes, one instance of cp -p ... path/to/copy is invoked for each file found.
<5> the {} is replaced by the filename
<15> ok
<16> hello, i forgot how to ***ign action with a signal, could someone remaind me it?
<4> trap
<16> thx
<15> how would you find the newest file in a directory
<15> or would you use sort
<4> ls -t
<15> only the newest file
<5> That's a FAQ, but alas, there's no good answer to it.
<5> ls -t is fine IF you can ensure there are no newlines in the filenames.
<15> ok


Name:

Comments:

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






Return to #bash
or
Go to some related logs:

autostart vmware suse
irongland
dapper midi /dev/sequencer
cdemwell
(X_GLXMakeCurrent) FC5 ATI
#lisp
markstruckcenter
#javascript
server vga=771
bluetooth TIOCGSERIAL



Home  |  disclaimer  |  contact  |  submit quotes