Hello Greg, hello *!
> And here's a workaround:
>
> unicorn:~$ bash --noprofile --norc -i -c $'alias x="echo hallo"; x'
> bash: x: command not found
> unicorn:~$ bash --noprofile --norc -i -c $'alias x="echo hallo"\nx'
> hallo
Really cool - thanks!
> Put a literal newline in the -c argument, rather than a semicolon.
>
> Or -- and I know this answer will be rejected, because it's too simple
> and sensible -- stop using aliases in scripts.
Or even stop using them at all,
alias egrep1='grep -E'
doesn't save much compared to
egrep2() { grep -E "$@" ; }
Or is there a reason why one shouldn't use this in an interactive shell?
Best regards
Martin