好的,所以我将它保存为 test.sh 和 chmod +x 脚本。
nmcli con up id myvpn=
/opt/google/chrome/google-chrome %U
geany /home/crunch/downloads/lr.txt
我使用终端执行它,但是它只连接到 vpn 并运行 chrome,Geany 仅在我关闭 chrome 后执行,任何建议。
好的,所以我将它保存为 test.sh 和 chmod +x 脚本。
nmcli con up id myvpn=
/opt/google/chrome/google-chrome %U
geany /home/crunch/downloads/lr.txt
我使用终端执行它,但是它只连接到 vpn 并运行 chrome,Geany 仅在我关闭 chrome 后执行,任何建议。
在 Linux 中,将您的行粘贴到一个新文件中,并在一行前面加上一个shebang:
#!/bin/bash
nmcli con up id myvpn
/opt/google/chrome/google-chrome %U
pidgin
geary /etc/crunchbang/notes.txt
然后做一个chmod +x filename
(用你使用的文件名替换文件名),给它执行权限。
unix 不需要特殊的文件扩展名。
只需将 4 行放入文件中即可。
然后,chmod u+x 文件
,这样文件就可以被执行了。
此外,确保 PATH 变量包含存储程序 nmcli、pdgin、geary 的目录。
或者,使用完整路径,就像 google-chrome 行一样。