如何将命令放在SH文件中

时间:2014-03-16 15:28:42

标签: bash file terminal command

我正在使用葡萄酒打开游戏并打开游戏我必须在终端中输入以下命令

cd "/home/brandon/.wine/dosdevices/c:/Program Files/League of Legends/RADS/system"

然后我在下面输入

WINEDEBUG=+ntdll wine "rads_user_kernel.exe" run lol_launcher $(ls ../projects/lol_launcher/releases/) LoLLauncher.exe

然后游戏正常加载。

是否可以将第一个命令和第二个命令放在.sh文件中,这样我只需双击它就会自动完成所有内容?

2 个答案:

答案 0 :(得分:2)

#!/bin/bash
cd "/home/brandon/.wine/dosdevices/c:/Program Files/League of Legends/RADS/system"
WINEDEBUG=+ntdll wine "rads_user_kernel.exe" run lol_launcher $(ls ../projects/lol_launcher/releases/) LoLLauncher.exe

如果我理解你的问题,这应该通过脚本运行两个命令。

您还必须

chmod u+x name_of_script

然后才能运行它。

答案 1 :(得分:0)

试试这个:

#!/bin/bash

echo "Start"

cd "/home/brandon/.wine/dosdevices/c:/Program Files/League of Legends/RADS/system"

WINEDEBUG=+ntdll wine "rads_user_kernel.exe" run lol_launcher $(ls ../projects/lol_launcher/releases/) LoLLauncher.exe

banner "End"