shell_exec 不执行所有命令

问题描述 投票:0回答:0

我的问题是 shell_exec 没有应用 bash 文件中的所有命令,即

dosemu -dump "file.com"
。它不输出任何错误,什么都没有。也许有任何争论要跑? (启动在 ubuntu 服务器上使用 sudo 进行) 这个命令在我的本地机器上运行良好。

是否有运行 com 文件并直接输出到控制台的替代方法?

我正在试验 Linux 中的 masm 编译器。 这是完整的 bash 脚本

if [ $# -ne 2 ]; then
    exit
fi

masm_path="$(cd -- "$(dirname "$0")";pwd)"
bin="$masm_path/masm/bin"
run_path=$(pwd)
file_path=$run_path/$1

if [ -f "$file_path/$2.asm" ]; then
    mkdir -p "$file_path/$2"
    mv "$file_path/$2.asm" "$file_path/$2"
fi

rm -f "$file_path/$2/output"
a=$(wine "$bin/ml.exe" /nologo "${file_path//\//\\}\\$2\\$2.asm" /Bl "$bin/link16.exe" -link /nologo)

echo ${a//${file_path//\//\\\\}\\$2\\$2.asm/} >> "$file_path/$2/output"

if echo "$a" | grep 'error'; then
  exit
fi

echo "" >> "$file_path/$2/output"
echo "Output:" >> "$file_path/$2/output"

#This is doesn't work
(dosemu -dumb -td -d "$run_path/$2.com") >> "$file_path/$2/output"

mv "$run_path/$2.obj" "$file_path/$2"
mv "$run_path/$2.com" "$file_path/$2"

我尝试直接从控制台运行命令并且它有效,将它移动到不同的地方并启动它,规定了各种启动参数

php bash ubuntu masm masm32
© www.soinside.com 2019 - 2024. All rights reserved.