shell?ù′?á·?°<ò?>

来源:未知 责任编辑:责任编辑 发表时间:2015-09-17 09:43 点击:

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??í

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • /etc/fstab 详解
    •  LVS-NAT和LVS-DR模式的实现详解
    •  RHCE考试之磁盘配额
    • nginx主主集群
    •  LVM逻辑卷管理器
    • 学习笔记:ACL详解
    • suse linux双网卡双网关配置
    • puppet文件服务配置
    •  Linux System and Performance Monitoring(Network篇)

    快速直达

    操作系统导航

    LinuxWindows虚拟机
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1