bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forwarded weirdness report


From: Martin Schulte
Subject: Re: forwarded weirdness report
Date: Tue, 29 Mar 2022 08:38:23 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]