4 ms·
> bash only honors aliases in POSIX mode. Aliases certainly _work_ in bash (even when not in POSIX mode. What do you mean by "honors"?
by joombaga 4y ago
> bash only honors aliases in POSIX mode.
Aliases certainly _work_ in bash (even when not in POSIX mode. What do you mean by "honors"?
- chasil 4y agoBash will not expand aliases within a shell script unless it is in POSIX mode. When not in POSIX mode, aliases are only expanded for interactive use. $ echo '#!/bin/sh \n alias p=printf \n p %s\\\\n "hello world!"' > ok.sh $ chmod 755 ok.sh $ ./ok.sh hello world! $ echo '#!/bin/bash \n alias p=printf \n p %s\\\\n "hello world!"' > nope.sh $ chmod 755 nope.sh $ ./nope.sh ./nope.sh: line 3: p: command not found