Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将xinit与我传递的bash结合起来作为参数,有可能吗?_Bash - Fatal编程技术网

将xinit与我传递的bash结合起来作为参数,有可能吗?

将xinit与我传递的bash结合起来作为参数,有可能吗?,bash,Bash,我用PlayOnlinux来赢得一些老冠军。我通常在新的X窗口中启动非常旧的 #!/bin/bash xinit '/home/deckoff/.PlayOnLinux/shortcuts/heroes.sh' -- :1 -ac -depth 16 这是实际sh文件的内容,主要由PlayOnLinux创建 #!/bin/bash xrandr -s 800x600 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLIN

我用PlayOnlinux来赢得一些老冠军。我通常在新的X窗口中启动非常旧的

#!/bin/bash

xinit  '/home/deckoff/.PlayOnLinux/shortcuts/heroes.sh' -- :1 -ac -depth 16
这是实际sh文件的内容,主要由PlayOnLinux创建

#!/bin/bash

xrandr -s 800x600

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/deckoff/.PlayOnLinux//wineprefix/HOMM3"
export WINEDEBUG="-all"
cd "/home/deckoff/.PlayOnLinux//wineprefix/HOMM3/drive_c/./Program Files/GOG.com/Heroes of Might and Magic 3 Complete"
POL_Wine "Heroes3.exe"  "$@"
有没有办法将两个脚本合并为一个脚本,我尝试了分叉,但有点失败了

您可以尝试以下方法:

#!/bin/bash
xinit -- :1 -ac -depth 16 <<EOF

xrandr -s 800x600

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/deckoff/.PlayOnLinux//wineprefix/HOMM3"
export WINEDEBUG="-all"
cd "/home/deckoff/.PlayOnLinux//wineprefix/HOMM3/drive_c/./Program Files/GOG.com/Heroes of Might and Magic 3 Complete"
POL_Wine "Heroes3.exe"  "$@"
EOF

xinit/dev/stdin--:1-ac-depth 16您可以尝试以下方法:

#!/bin/bash
xinit -- :1 -ac -depth 16 <<EOF

xrandr -s 800x600

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/deckoff/.PlayOnLinux//wineprefix/HOMM3"
export WINEDEBUG="-all"
cd "/home/deckoff/.PlayOnLinux//wineprefix/HOMM3/drive_c/./Program Files/GOG.com/Heroes of Might and Magic 3 Complete"
POL_Wine "Heroes3.exe"  "$@"
EOF


xinit/dev/stdin--:1-ac-depth 16这三个都不起作用:(Xinit将启动新的X,等待几秒钟,然后退出。实际的脚本-游戏的开始从未发生过。@deckoff:Hmmm…这很奇怪,因为here doc所做的事情基本上与您问题中的第一个脚本相同。我刚才试过的是-Xinit的语法非常不灵活Xinit/path/script-参数可以工作,though xinit--arguments/path/script不会。如果我正确地阅读了您的示例,则会在触发另一个脚本之前传递这些参数。@deckoff:第二个和第三个变体会将脚本主体拉入第一个参数。这三个变量都不起作用。:(Xinit将启动新的X,等待几秒钟,然后退出。实际的脚本-游戏的开始从未发生过。@deckoff:Hmmm…这很奇怪,因为here doc所做的事情基本上与您问题中的第一个脚本相同。我刚才试过的是-Xinit的语法非常不灵活Xinit/path/script-参数可以工作,though xinit--arguments/path/script不会。如果我正确阅读了您的示例,那么这些参数会在触发另一个脚本之前传递。@deckoff:第二个和第三个变体将脚本主体拉入第一个参数。
xinit /dev/stdin -- :1 -ac -depth 16 <<EOF