Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个abc在搜索路径中命名的程序,并且我编写了一个包含以下内容的脚本:
abc
#!/bin/sh abc() { echo Hello } $1
使用参数调用此脚本abc会调用该函数。有没有办法总是运行外部程序?
好的,这似乎可以完成工作:
#!/bin/sh abc() { echo Hello } # calls whatever the argument contains in a new context sh -c $1 # I can still call my function abc