[go: up one dir, main page]

Today I Learned

tags


2022/02/08

In zsh, ls *(n) will “human-sort” mostly-numeric filenames.

https://zsh.sourceforge.io/Doc/Release/Expansion.html#Glob-Qualifiers

https://twitter.com/nedbat/status/1491032300800421892


2022/07/29

that in bash and zsh, you can put a newline in a variable like so:

newline=$'\n'
echo ">>>${newline}<<<"

learned from: https://stackoverflow.com/a/4456399/6571327


2022/10/24

That you can list all addresses in terraform state by running

terraform state list

Docs at https://developer.hashicorp.com/terraform/cli/commands/state/list


Also, that compgen -v is a function, at least on Mac zsh. Apparently in zsh compgen -v calls something like

for var_name in "${(k)parameters[@]}"; do
  printf '%s\n' "$var_name"
done

which is the first time I’ve seen that kind of shell syntax. It generates a bad substitution message in bash 3.2, so I can only assume it’s zsh-specific.


2024/05/03

That zsh lazily+automatically loads scripts found in directories in $FPATH: https://www.linuxconsultant.org/zsh-autoload-a-guide-to-dynamic-loading-in-zsh/


2025/01/08

That zsh completions in /usr/share/zsh/vendor-completions must start with a _ in order to work, e.g. /usr/share/zsh/vendor-completions/_rg. Not sure why, though.


While you can use the same SSH key for both authentication and signing, NIST recommends you shouldn’t: https://gist.github.com/ChristopherA/3d6a2f39c4b623a1a287b3fb7e0aa05b

git config commit.gpgSign true
git config tag.gpgSign true
git config gpg.format ssh
git config user.signingKey 'ssh-ed25519 AAAA...xyz'