#musicbrainz-devel

/

      • ocharles
        which looks very od
      • odd*
      • kepstin-work
        yeah, i think that the result of $() is only IFS-split, I don't think it's parsed for quotes or anything.
      • alastairp
        with the extra 's?
      • ocharles
        yea
      • kepstin-work: IFS?
      • kepstin-work
        inter-field separator. by default, whitespace.
      • if you need the quotes parsed, you might have to run the thing through an eval :/
      • ocharles
        i want it to look like that copy and paste
      • i don't think i want any parsing
      • alastairp
        oh, I think I see what it's doing with the quotes
      • kepstin-work
        so you want ['-g', '"-package-conf', '/nix/store...', ...]
      • alastairp
        quoting word-by-word, so when you eval it, the "s are in the right place
      • ocharles
        no, I want ['-g', '-package-conf /nix/store']
      • alastairp
        try ` ` instead of $()
      • it shouldn't be any different...
      • ocharles
        same
      • kepstin-work
        ocharles: yeah, I think you're gonna have to run that through an eval to get the quotes parsed properly :/
      • eval "ghc-mod list $(stuff here)"
      • might do it
      • alastairp
        echo $(echo "a b"); echo $(echo '"a' 'b"'); eval echo $(echo '"a' 'b"')
      • ocharles
        alright, i'll give that a shot
      • booya
      • alastairp
        yuck
      • ocharles
        heh
      • alastairp
        kepstin-work: shell-high-5
      • ocharles
        kill -HIGH5 kepstin-work
      • alastairp
        SIGHIGH5
      • ocharles
        next question...
      • alastairp
        sounds like something that someone needs to write a april-1 rfc about
      • kepstin-work doesn't feel good about that, but it'll do :/
      • ocharles
        how can I do $2 $3 $3 $5... ?
      • alastairp
        $@
      • ocharles
        basically array splices
      • alastairp: that includes $1
      • alastairp
        oh
      • shift
      • $@
      • ocharles
        ok, i'll try that
      • alastairp
        I think it's shift
      • ocharles googles
      • kepstin-work
        yeah, shift will remove the first thing from an array
      • there might be some fancier array slicing stuff available tho, hmm.
      • alastairp
        otherwise, I think you can index arrays with {}, or [], or :
      • kepstin-work
        nope, no fancy subscripts.
      • ... yeah, looks like using shift and $@ is your best option there
      • making sure to quote $@ appropriately based on how you want it split :)
      • ocharles
        so I should save $1 first?
      • kepstin-work
        you'd have to, yeah.
      • ocharles
        ok, cool
      • kepstin-work
        it looks like there's no easy way to undo the shift and put it back
      • ocharles
        i can live with that
      • yay, all 2000 haskell modules I have installed now show up in Vim omnicompletion :)
      • alastairp
        ah, "$@". I remember you well
      • kepstin-work
        always fun to write shell scripts that end in 'exec /bin/foo "$@"' :)
      • ocharles
        so if you do "$@", that means $1 goes to foo $1 and $2 goes to foo $2?
      • because that's pretty much what I want to do
      • kepstin-work
        "$@" is basically the same as "$1" "$2" "$3" ...
      • alastairp
        whereas $@ is unescaped, so if it's 3 things long, and $2 has a space in it, the program it's passed to will get 4 args
      • kepstin-work
        yeah, shell quoting is *fun* :/
      • ocharles
        urgh
      • kepstin-work
        unless you're explicitly desiring word splitting, pretty much every variable reference should be used in quotes.
      • but then, there are cases when the word-splitting is actually desired :)
      • alastairp
        hmm. I've never tried to set IFS to something other that whitespace
      • does it work?
      • kepstin-work
        alastairp: yeah, but it gets really confusing really fast.
      • alastairp
        :)
      • djce joined the channel
      • hey, $* is pretty cute
      • That is, "$*" is equivalent to "$1c$2c...", where c is the first character of the value of the IFS variable.
      • kepstin-work
        the tricky bit with playing with IFS is making sure it's only set where you want it, and then unset/reset right afterwards
      • sometimes you only want it set for a part of a single command, so you end up using subshells and stuff.
      • but yeah, "The order of expansions is: brace expansion, tilde expansion, parameter, variable and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and pathname expansion."
      • which is why the word-splitting ran after the command-substitution
      • although it gets really confusing when quotes are involved :/
      • jonjomckay joined the channel
      • I guess the quotes are handled when parsing the command-line, prior to any of the expansions being run
      • although quotes effect the behaviour of later expansions
      • ocharles
      • kepstin-work is somewhat annoyed that they dropped the trackpoint buttons
      • but more importantly i want the damn t440s to come out so i can buy it
      • my t400 that overheats when you use two cores is not fun anymore :(
      • kepstin-work
        hmm, that's... (sunglasses) not cool.
      • ocharles
        i don't really care about that, i dock it and use much better input devices
      • i guess it's a minor inconvenience when i'm at home
      • kepstin-work
        I use my laptop mostly on the go; if I'm somewhere where I could use good input devices, I have a proper desktop :)
      • although I do have a decent bluetooth mouse
      • ijabz joined the channel
      • ocharles
        kepstin-work: well i work from my office, but sometimes (like today) i choose to work from home
      • so a desktop doesn't really work for me anymore
      • kepstin-work hopes they haven't dropped the bluetooth option from the new models :)
      • alastairp
        kepstin-work: !!what?
      • kepstin-work
        yeah, so much of my stuff is virtual servers or cloud stuff that it doesn't really matter where I'm working from as long as I have my git checkouts and ssh keys
      • kepstin-work is probably looking at getting an X240 with that fancy high-res screen
      • alastairp
        I was just reading about the guy with the ipad and keyboard again
      • ocharles
        kepstin-work: i considered that, but then that doesn't work for my commutes
      • kepstin-work still likes his R61, but it's getting a bit old now :)
      • kepstin-work
        this upcoming summit will probably be the last trip I make with it :)
      • alastairp
      • kepstin-work
        ...
      • alastairp
        acutally, I've got to hand this to google
      • kepstin-work
        "* Please note: KITKAT 4.4 is only weightless when sent into outer space."
      • alastairp
        they've got a lot of people talking about it
      • reosarevok joined the channel
      • ocharles
        i'm not happy that nestle now have something to do with my phone
      • alastairp
        (for those who missed it, android 4.4 is codenamed kitkat, in an actual licensing deal with nestle)
      • reosarevok
        ...
      • wtf
      • kepstin-work is off.
      • Dremora joined the channel
      • andreypopp joined the channel
      • basic` joined the channel
      • marcooliveira joined the channel
      • reosarevok joined the channel
      • marcooliveira joined the channel