且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何获得" previous执行命令"在bash脚本?

更新时间:2022-06-09 08:27:45

类似

fc -ln -1

应该工作。这就是说,你很可能运行到并发访问的问题(阅读:多壳覆盖彼此的历史),你可能无法用手做得更好

should work. That said, you're probably running into concurrent access issues (read: multiple shells overwriting each others' history) and you may not be able to do any better by hand.