Tuesday, 23 September 2008

Looping Contoh Scripts di LINUX

ini contoh yang sering dapat waktu matakuliah program baik Pascal, C++, VB

$ vi cthArray

#
#!/bin/bash
# Created : David Windarto
#
echo "Hasil Looping adalah"
for ((i=1; i<=5; i++))
do
for ((j=1;j<=i;j++))
do
echo -n "$i"
done
echo ""
done


jalankan
$./cthArray

hasilnya
========
1
22
333
4444
55555

No comments: