.bashrc sets up a bunch of aliases for me to use as needed, and then runs one of them automatically.
Turns out this caused some problems with automated scripts ssh-ing into my machine, as opposed to using an interactive shell. So, to fix this, I put them inside an if block so they wouldn't be defined or run for those automated scripts...
if [ -n "$TERM" ] && [ "$TERM" != "dumb" ] ; then alias short='long command here' alias another='very long command here' # ... short fi
Only to see
short: command not found!
Let's reduce this to the minimum...
$ cat alias.sh alias foo='echo hi' foo
$ sh alias.sh hi
cat alias-in-if.sh if true ; then alias foo='echo hi' foo fi
sh alias-in-if.sh alias-in-if.sh: line 3: foo: command not found
Why does the first script work, and not the second?
(I've answered my own question.)