这里有一个noobie Linux学习者.
我创建了一个python脚本和chmod 700 filename.py,当我打算使用./filename.py时,我的讲师来了并使用./!$来运行该文件.
实际意味着./!$是什么意思?我无法谷歌出来.我也非常感谢cheatsheet的类似推荐链接.
提前致谢.
解决方法:
假设我刚刚运行了一个命令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
确认我的直觉.
标签:bash,linux
来源: https://codeday.me/bug/20190523/1155494.html