Nikita Bobko

@bobko
76 Followers
12 Following
32 Posts
Amateur yak shaver. Creator of AeroSpace - tiling window manager for macOS. ex-Kotlin, ex-JetBrains
Bloghttps://www.bobko.xyz
GitHubhttps://github.com/nikitabobko
Twitterhttps://twitter.com/nikitabobko

In old bash versions, an array expansion ${arr[@]} of an empty array fails with "unbound variable" error

Workaround: write ${arr[@]+"${arr[@]}"}
https://stackoverflow.com/questions/7577052/unbound-variable-error-in-bash-when-expanding-empty-array

I know that bash is a disaster, but I still felt a WAT moment

Unbound variable error in bash when expanding empty array

I'm writing a bash script which has set -u, and I have a problem with empty array expansion: bash appears to treat an empty array as an unset variable during expansion: $ set -u $ arr=() $ echo "f...

Stack Overflow
I wish computers could search by substring