标签:this mkdir user success his list shell命令 please read
#! /bin/bash#!/bin/bash
read -p "please set file:" n
if[ ! -e $n ]
then
touch $n
fi
#!/bin/bash
n=cat iplist
for IP in $n
do
ping -c 3 -i 0.2 -w 3 $IP &> /dev/null
if [ $? -eq 0 ] ; then
echo "Host $IP is on-line."
else
echo "Host $IP is off-line."
fi
done
#!/bin/bash
read -p "please set directory:" n
if [ ! -e $n ]
then
mkdir -p $n
else
echo "this $n directory exist"
fi
read -p "Enter your score (0-100) : " GRADE
if [ $GRADE -ge 85 ] && [ $GRADE -le 100 ] ; then
echo "$GRADE is Excellent"
elif [ $GRADE -ge 70 ] && [ $GRADE -le 84 ] ; then
echo "$GRADE is Pass"
elif [ $GRADE -gt 100 ] || [ $GRADE -lt 0 ] ; then
echo "$GRADE is does not exist"
else
echo "$GRADE is FAil"
fi
#!/bin/bash
read -p " Enter a name : " n
if [ -e $n ] && [ -d $n ] ; then
echo "$n is directory"
elif [ -e $n ] && [ -f $n ] ; then
echo "$n is file"
else
echo "$n is does not exist"
fi
#!/bin/bash
read -p "Enter The Users Password : " n
for u in cat forlist
do
id $u &> /dev/null
if [ $? -eq 0 ]
then
echo "Already exists"
else
useradd $u $> /dev/null
echo "$N" | passwd --stdin $u &> /dev/null
if [ $? -eq 0 ]
then
echo "$u ,Create success"
else
echo "$u ,Create failure"
fi
fi
done
标签:this mkdir user success his list shell命令 please read
原文地址:http://blog.51cto.com/13956297/2286834