本文共 547 字,大约阅读时间需要 1 分钟。
1.vim mkcdrom.sh
2.#!/bin/bashDIR="/media/cdrom"if [ ! -e $DIR ]thenmkdir -p $DIRfi3.4.vim chkhost.sh5.#!/bin/bashping -c 3 -i 0.2 -W 3 $1 &> /dev/nullif [ $? -eq 0 ]thenecho "Host $1 is On-line."elseecho "Host $1 is Off-line."fi6.7.vim chkscore.sh8.#!/bin/bashread -p "Enter your score(0-100):" GRADEif [ $GRADE -ge 85 ] && [ $GRADE -le 100 ] ; thenecho "$GRADE is Excellent"elif [ $GRADE -ge 70 ] && [ $GRADE -le 84 ] ; thenecho "$GRADE is Pass"elseecho "$GRADE is Fail" fi9.转载于:https://blog.51cto.com/13956192/2286823