我在 bash 中输入两个命令:
$export g='grep "something"'
$echo "something and another thing" | $g
但它不起作用。
我希望第二条命令由 bash 评估为:echo "something and another thing" | grep "something"
我应该怎么做呢?
答案1
使用别名。
alias g='grep "something"'
echo "something and another thing" | g