Comment

Comment by photon-torpedo

Good question. Something to do with interactive mode?

  $ cat l.sh
  alias l=ls
  l
  $ sh l.sh
  file1  file2  l.sh
  $ bash l.sh
  l.sh: line 2: l: command not found
  $ bash -i l.sh
  file1  file2  l.sh
Edit: Ah yes, the man page says so.

> Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton