摘要:#!/bin/sh
if test $1 -gt 12 then
echo "参数大于12!"
exit
else
i=$1
j=1
while test $i -ne 0
do
j=`expr $j \* $i`
i=`expr $i -1`
done
echo $j
fi
阅读全文
随笔分类 - shell编程
摘要:echo -e ${PATH//:/\\n}
注:bash字符串比较
阅读全文
摘要:#!/bin/bash
IFS=:
while read name pass uid gid gecos home shell
阅读全文