code1

macname@localhost Desktop % 
macname@localhost Desktop % cat test.sh 
#!/bin/bash
echo "Start the test script"
count=1
while [ $count -le 5 ]
do
   echo "Loop #$count"
   sleep 5
   count=$[ $count + 1 ]
done
echo "Test script is complete" 
macname@localhost Desktop % 
macname@localhost Desktop % ./test.sh 
Start the test script
Loop #1
Loop #2
Loop #3
Loop #4
Loop #5
Test script is complete
macname@localhost Desktop % 
macname@localhost Desktop % 

code2

macname@localhost Desktop % 
macname@localhost Desktop % 
macname@localhost Desktop % cat test.sh 
#!/bin/bash
echo "Start the test script"
./a.sh &
./a.sh &
./a.sh &
macname@localhost Desktop % 
macname@localhost Desktop % 
macname@localhost Desktop % cat a.sh 
#!/bin/bash
echo "Start the test script"
count=1
while [ $count -le 5 ]
do
   echo "Loop #$count"
   sleep 5
   count=$[ $count + 1 ]
done
echo "Test script is complete" 
macname@localhost Desktop % 
macname@localhost Desktop % 
macname@localhost Desktop % ./test.sh
Start the test script
macname@localhost Desktop % Start the test script
Loop #1
Start the test script
Loop #1
Start the test script
Loop #1
Loop #2
Loop #2
Loop #2
Loop #3
Loop #3
Loop #3
Loop #4
Loop #4
Loop #4
Loop #5
Loop #5
Loop #5
Test script is complete
Test script is complete
Test script is complete

macname@localhost Desktop % 
macname@localhost Desktop % 

 

 

 

 

 

 

 

 

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2021-06-07
  • 2021-05-20
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案