Randy-Blancett / bashLibrary

Library of bash script utilities
MIT License
0 stars 1 forks source link

Add a function to create user if not exists #9

Closed Randy-Blancett closed 1 year ago

Randy-Blancett commented 1 year ago

want a function that will create a user if it doesnt exist, may all so want a general function to check if user exists

https://stackoverflow.com/questions/14810684/check-whether-a-user-exists

if id "$1" &>/dev/null; then echo 'user found' else echo 'user not found' fi