Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true
- do
- echo -n "Enter a UID: "
- read uid
- if [ $uid -le 1000 -o $uid -ge 65537 ]; then
- echo "Invalid number. Range 1000..65537"
- continue
- elif cat /etc/passwd | awk -F':' '{ print $3 }' | grep $uid; then
- echo "UID already exists, please choose another";
- continue
- else break;
- fi
- done
- echo "Your UID is ${uid}";
Advertisement
Add Comment
Please, Sign In to add comment