huf [he/him]

  • 0 Posts
  • 53 Comments
Joined 3 years ago
cake
Cake day: November 11th, 2021

help-circle





  • when you create the alias, the shell substitutes the $1 (to nothing, probably) since your alias is in "" (double quotes).
    now, if you swap the single and double quotes, then the substitution still happens, but at invocation time instead of at definition time.
    you actually want perl to deal with this $1, so neither is good.

    you have three options:

    • write a function instead, as has been suggested
    • use $'' quoting, which lets you put ’ (single quote) inside ’ (single quote) without going mad: alias cica=$'foo \'$bar\' baz'
    • go insane and do this: alias cica='foo '\''$bar'\'' baz' (this is the old way, without bash’s $'')












    • atools, which includes als, aunpack, apack. so you can stop caring about the kind of archive and just unpack it. it also saves you from shit archives that have multiple files/dirs in their root.
    • perl -e / perl -lne / …
    • units
    • bc - a calculator that’s actually good
    • pass - the only non-shit password store tool i’ve found so far. no gui, uses gpg and git to do the encrypting and storage/sharing
    • alias lr='ls -lrth' - so you can easily find the newest file, cos that’s frequently what you want
    • unip - my script to look up things in the unicode db
    • find -type f -exec xzgrep 're' {} + - because xzgrep cant do -r

    oh yeah, and for the shell readline, alt-b, alt-f, ctrl-w, ctrl-u, ctrl-k, ctrl-a, ctrl-e