"Gurjeet Singh" <[EMAIL PROTECTED]> wrote:
> 1$ cat setenv.sh
> #!/bin/sh
>
> alias llrt='ls -lrt'
...
> 5$ . ./setenv.sh && llrt && . ./unsetenv.sh
> sh: llrt: command not found

Aliases are expanded when a command is read, not when it is executed.
The entire && chain of commands forms a single compound command, which
is completely read before any of it is executed, so the alias is not
defined yet at the point when it would be expanded.


paul


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to