@zephyr to [email protected] • 1 year agoHow do you shell expand your variables and why?imagemessage-square27arrow-up169arrow-down14cross-posted to: [email protected]
arrow-up165arrow-down1imageHow do you shell expand your variables and why?@zephyr to [email protected] • 1 year agomessage-square27cross-posted to: [email protected]
minus-squareGammalinkfedilinkEnglish6•edit-21 year agoTypically find "$HOME/docs", but with a few caveats: In Zsh or Fish, the quotes are unnecessary: find $HOME/docs If I’m using anything potentially destructive: mv "${HOME:?}/bin" ... Of course, if it’s followed by a valid identifier character, I’ll add braces: "${basename}_$num.txt"
Typically
find "$HOME/docs"
, but with a few caveats:In Zsh or Fish, the quotes are unnecessary:
find $HOME/docs
If I’m using anything potentially destructive:
mv "${HOME:?}/bin" ...
Of course, if it’s followed by a valid identifier character, I’ll add braces:
"${basename}_$num.txt"