I want to create BASH file to create 50 users with while.
But i got some problems when i run it.
limite=51
num=1
while [$numero != $limite]
do
echo -n 'enter your name: ' "$num" ; read name
sudo useradd $name
num=$(($num + 1))
done
the problems come from line 1 and line 4
I don’t know why!?
WEll, i have this and it works
limite=51
num=1
while [ $num != $limite ] ; do
echo -n 'enter your name: ' "$num" ; read name
sudo useradd $name
num=$(($num + 1))
done
Thx to you
[is actually a command so it needs a space after it, line 4 should beJust like
catfile1would complain so does[$numero, doman testfor more information or evenman bash.Also if this is the complete script what is
$numero, should it be$num?