shell?ù′?á·?°<ò?>
1?¢òa?óó??§ê?è?D???£??êá?£?D?±e
#!/bin/bash
read -p "Please input your name:" name
read -p "Please input your age: " age
read -p "Please input your sex:" sex
echo "Your name is $name,age is $age,sex is $sex."
2?¢D′ò?????±?arvg.sh,?éò??áè?ó??§ê?è?μ?2?êy±?á?£?è?sh arvg.sh test12 ,è?oó?êó??§ê?·?òa′′?¨????£?
è?1?ó??§??′eyes?ò??YES£??ò?aó??§′′?¨????£?è?oó?êó??§ê?·??a??′′?¨???t£?è?1???′eyes£??ò?ú??2?ò??-
′′?¨o?μ???????′′?¨test01?£
#!/bin/bash
if [ $# -lt 1 ];then
echo "Please like 'sh test.sh a b c'"
fi
read -p "are you mkdir file?Please enter yes/YES or no:" qq
if [ $qq == yes ] || [ $qq == YES];then
mkdir $1
for i in $(seq 1 10);
do
touch $1/test$i
done
else echo "No file created"
exit 0
fi
3?¢???ú?ü???ü??£o
#!/bin/bash
#2011/07/10 by larry
LOG=PassChange`date +%F`.log
> $pass
cat /etc/passwd | while read line
do
id=`echo $line | awk -F":" '{print $3}'`
user=`echo $line | awk -F":" '{print $1}'`
PASS=$RANDOM
if [ $id -lt 500 ];then
echo "$user is system users."
elif [ $id -gt 500 ];then
echo $RANDOM | passwd $user --stdin
echo "$USER $id $RANDOM" >> $LOG
fi
done
#####################################
#!/bin/bash
#2011/07/10
now=`date +%F`
file=/etc/passwd
for user1 in `cat $file | awk -F: '$3<500{print $1}'`
do
echo $user1 is systerm user
done
for user2 in `cat $file | awk -F: '$3>500{print $1}'`
do
echo $RANDOM |passwd $user2 --stdin >> /dev/null
echo "$user2 $RANDOM" >> Pass$now.log
done
±???3?×? “Larry?§?°???·” 2??í
相关新闻>>
- 发表评论
-
- 最新评论 更多>>