我不能给出太多解释,因为我的英语不好。下面是我想要做的例子;shell脚本 - 我如何进行多次读取?
try.sh
#!/bin/sh
echo -n "Enter the port:"
read ports
if [ ! -d "$ports" ]; then
mkdir -p /root/port$ports
echo "The folder was created for $ports"
wget -q www.example.com/example.tar.bz2
tar -xjf example.tar.bz2
su root -c "screen -A -m -d -S 'example$ports' ./example -RunningAsRootIsEvilAndIKnowThat"
echo "$ports started."
else
exit 0
fi
腻子;
[email protected]:~# sh try.sh
Enter the port: 4445, 4546
Created folder 'port4445'
Created folder 'port4546'
4445 started.
4546 started.
我该怎么做?
还有,你在shell脚本试过吗? – Raptor
什么都没有。我不知道怎么做。 –
为什么你用','作为分隔符?我会简单地使用空间 – hek2mgl