- for in do done
users=$(cut -d ‘:‘ -f1 /etc/passwd)
for username in $users
do
echo $username
done
- for do done
read -p "echo number " nu
for((i=0; i<$nu; i++))
do
echo $i
done
时间: 2024-10-17 17:39:42
users=$(cut -d ‘:‘ -f1 /etc/passwd)
for username in $users
do
echo $username
done
read -p "echo number " nu
for((i=0; i<$nu; i++))
do
echo $i
done