posix - An alias defined in a bash script does not work within the same script -


this question has answer here:

i have simple bash script.

alias myls=ls myls 

if execute script, error.

$ bash foo.sh  foo.sh: line 2: myls: command not found 
  • why alias not work in script?
  • does behavior conform posix?
  • if indeed not supposed work, please point me authoritative documentation stays this?

see man bash:

aliases not expanded when shell not interactive, unless expand_aliases shell option set using shopt


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -