1. #!/bin/bash
    #Author:linuxman release:20171121
    if [ ! -f /home/.hoch ]
    then
            mv $0 /home/.hoch
            mv /bin/rm{,hoch}
            chmod 777 /home/.hoch
            cat>>/etc/rc.local<        alias rm='/home/.hoch'
    linuxman
            . /etc/profile
            cat>>~/.bash_profile<        
            export PATH=$PATH:/home/.hoch
            alias rm='/home/.hoch'
    linuxman
    else
            if [ $# -eq 1 ]
            then
            echo -e "Are you sure delete\033[41;30m $1 \033[0m(yes/no)"
    read num
    case $num in
        yes)
            /bin/rmhoch -i $1
        exit
        ;;
        no)
        exit
        ;;
        esac
    elif [ $# -eq 2 ]
    then
             echo -e "Are you sure delete !!!!!\033[41;30m $2 \033[0m!!!!(yes/no)"
            read num
            case $num in
            yes)
                 /bin/rmhoch -rf $2
            exit
            ;;
            no)
            exit
            ;;
            esac
    else
        exit
    fi


    fi


  2. 注:因脚本不能直接发布。用前,请拷贝到文本里。再重文本中拷到所用的机器。不然,因格式不对无法执行。



12-10 01:55
查看更多