假设我在搜索路径中有一个名为abc的程序,并且我编写了一个脚本,其中包含以下内容:
#!/bin/sh
abc() {
echo Hello
}
$1使用参数abc调用此脚本将调用该函数。有没有办法总是运行外部程序而不是?
发布于 2013-08-13 11:36:36
好吧,这似乎是一项工作:
#!/bin/sh
abc() {
echo Hello
}
# calls whatever the argument contains in a new context
sh -c $1
# I can still call my function
abchttps://stackoverflow.com/questions/18205766
复制相似问题