home.social

#argv — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #argv, aggregated by home.social.

  1. Re prev toots, hypothetically, if I were to write a library called libextextglob that would grovel over an array of strings (like, say, ) and do horrible things to it if it sees globby characters that the shell didn't expand, would you think it was ...

    (updated to allow multiple choices, because the best crimes are in B♭ minor)

  2. My zshrc contains the following:

    setopt autocd
    function cd () {
    if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then
    [[ ! -e ${1:h} ]] && return 1
    builtin cd ${1:h}
    else
    builtin cd "$@"
    fi
    }
    alias ...='../..'
    alias ....='../../..'
    alias .....='../../../..'

    This allows things like `cd /etc/fstab` to go to `/etc`, `...` to go 2 directories up and `/blah/fasel` to go to `/bla/fasel` without explicit `cd`.

    I am basically lost on machines without that. 😿

  3. Some days you don’t get your own stuff done, but you do point out to someone else that they have loaded a high-caliber #footgun.

    #Sanitize your input, folks, and jealously guard your #argc and #argv.