我正在尝试在 Linux Ububtu 12.04 LTS 服务器上运行 shell 脚本。这是我的脚本:
#!/bin/bash
PROGRAM=./home/lab/data/setup_exp/Simulator
FILE_PART_PREFIX="/home/lab/data/pcap_partial/h_"
FILE_PART_NUM=3
RECEIVER_SIZE=4096
SENDER_SIZE=4096
BETA=0.25
UPDATE=400
MARKER=20
MODE=5
RESULT_PREFIX="/home/lab/data/setup_exp/size/size_eq4/res_"
time_part=1200
if [ ${time_part} -eq 1200 ];then
nohup ${PROGRAM} 1 ${FILE_PART_PREFIX}${time_part}.pcap ${RECEIVER_SIZE} ${SENDER_SIZE} ${BETA} ${UPDATE} ${MARKER} ${MODE} >> ${RESULT_PREFIX}${time_part} 2>&1 &
fi
time_part=1500
if [ ${time_part} -eq 1500 ];then
nohup ${PROGRAM} 1 ${FILE_PART_PREFIX}${time_part}.pcap ${RECEIVER_SIZE} ${SENDER_SIZE} ${BETA} ${UPDATE} ${MARKER} ${MODE} >> ${RESULT_PREFIX}${time_part} 2>&1 &
fi
time_part=1900
if [ ${time_part} -eq 1900 ];then
nohup ${PROGRAM} 1 ${FILE_PART_PREFIX}${time_part}.pcap ${RECEIVER_SIZE} ${SENDER_SIZE} ${BETA} ${UPDATE} ${MARKER} ${MODE} >> ${RESULT_PREFIX}${time_part} 2>&1 &
fi
然后,这些是上面脚本目录下的文件和子目录,叫做 sizesetup.sh :Simulator size sizesetup.sh
Simulator 和 sizesetup.sh 的权限设置为 755。
此外,Simulator 的输入文件在 下/home/lab/data/pcap_partial
,分别命名为 h_1200、h_1500 和 h_1900。
我的问题是我曾经sh sizesetup.sh
运行此脚本而没有弹出任何错误消息。然而,脚本没有被执行(我使用'top'和'ps'命令来检查脚本的状态)