以下是BShell中的For循环样例:
[root@node1 script]# cat for_test_ssh
echo "--"
echo "Starting looping."
echo "--"
for i in $(seq 1 2)
do
echo $i
echo "---"
done
[root@node1 script]# sh for_test_ssh
--
Starting looping.
--
1
---
2
---
[root@node1 script]#