さて!自慢の数行スクリプト

このエントリーをはてなブックマークに追加
31名無しさん@お腹いっぱい。
#!/bin/sh

# this script can repeat a certain command
# ex. scriptname 10 ls

i=0

if [ $# -lt 2 ]
then
echo "usage:$0 number command"
exit
fi

num=$1
shift

while [ $i -lt $num ]
do
$*
i=`expr $i + 1`
done
exit