gpt4 book ai didi

linux - ./!$ 在 Linux 中是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 00:31:35 25 4
gpt4 key购买 nike

这里是 Linux 新手。

我创建了一个 python 脚本和 chmod 700 filename.py,当我要使用 ./filename.py 时,我的导师来使用 。/!$ 运行文件。

./!$ 到底是什么意思?我无法用谷歌搜索出来。对于类似的推荐,我也非常感谢备忘单的链接。

提前致谢。

最佳答案

假设我刚刚运行了一个命令 python test.py。这是我进入 shell 的最后一条命令。但是,它的参数是 test.py

记住 ./ 指的是当前工作目录,当我键入 ./!$ 时,我得到以下输出:

$ ./!$
./test.py
./test.py: line 1: import: command not found
./test.py: line 2: $'\r': command not found
./test.py: line 3: syntax error near unexpected token `('
'/test.py: line 3: `df = pd.DataFrame([

根据上下文线索,我的最后一个参数被用作 !$

如果我输入多个参数,例如 python test.py test2.py,我会得到:

$ ./!$
./test2.py
./test2.py: line 1: import: command not found
Unable to initialize device PRN

证实我的直觉。

关于linux - ./!$ 在 Linux 中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38515790/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com