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.
我想做以下事情:
要实现第 2 步,应该使用哪些命令?
commandA && lastcommand=<some skillful commands> && echo '$lastcommand was executed successfully!'
bash没有任何东西可以自动执行此操作。
bash
与其尝试获取命令,不如将其放入变量中并执行该变量。
lastcommand=(commandA arg1 arg2 arg3) && "${lastcommand[@]}" && echo "${lastcommand[@]} was executed successfully"