我不能給出太多解釋,因爲我的英語不好。下面是我想要做的例子;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