日期:2014-05-16 浏览次数:20706 次
#!/bin/bash
while true
do
read -p "[localhost $PWD]$ " cmd
if [ "$cmd" = "end" ]
then
exit
fi
eval "$cmd"
done
#!/bin/bash
while true
do
read -p "Input command to execute: " cmd
(sleep 3; $cmd) &
pid=$!
while ps -ef
------解决方案--------------------
grep $pid
------解决方案--------------------
grep -v grep >/dev/null
do
echo "wait child process to be terminated"
sleep 1
done
wait $pid
status=$?
echo "The exit status of the child process is $status"
done