我尝试在bash函数中使用ls、cat等命令
Report() { ls $1 | sort -u } Report()
我得到了ls:命令未找到错误当我运行函数在bash函数中不能使用bash命令吗?我可以看到在函数中只使用echo的例子
s8vozzvw1#
在bash中调用函数时,不应使用括号
Report() { ls $1 | sort -u }; Report;
1条答案
按热度按时间s8vozzvw1#
在bash中调用函数时,不应使用括号