Skip Navigation

What are the most inscrutable lines of $SHELL you've ever written?

I'm sure some of you have absolute monstrosities of sigils (I know I do, in my .zshrc alone). Post them without context, and try and guess what other users's lines are. If you want to provide context or guess, use the markdown editor to spoiler-tag your guesses and explanations!

1
1 comments
  • ZDOTDIR="${${(%):-%x}:P:h}"
    
    Literal explanation
    • ${(%)...} enable prompt sequences
    • %x a prompt sequence which expands to the current file being executed
    • :P resolve symlinks
    • :h the parent directory
    Full context

    This line is in my ~/.config/zsh/.zshenv, which I symlink into my home directory. This resolves the symlink and sets $ZDOTDIR to the directory in which my zsh config files actually live, that way they aren't all in my home directory.