Ubuntu uses zsh, now has alias
alias | grep sayhi
sayhi='echo hi'
sayhi foo
hi foo
However, I cannot use this aliasin xargsor bash, see below
➜ ~ echo foo | xargs -i sayhi {}
xargs: sayhi: No such file or directory
➜ ~ echo foo | awk '{print "sayhi "$0}'
sayhi foo
➜ ~ echo foo | awk '{print "sayhi "$0}'|bash
bash: line 1: sayhi: command not found
It seems I cannot indirectly use aliasthe command line.
So how could I use aliasin this situation?
source
share