Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
create_user() {
read -p "Enter new username: " username
if id "$username" &>/dev/null; then
echo "Error: User '$username' already exists."
exit 1
fi