I have a bash script that creates an account and also it does the following:
echo "$USERNAME@youremail.com" >> "$alias_file"
This takes the newly created account and also adds their email address into the specified text file and then runs the "newaliases" command.
This works perfect however I have a delete_user.sh script and I would like to know how I can remove the users email address from the file using the script? I don't know how that would look like or how that needs to be added into the "delete_user.sh" script.
Does anyone know how the script can open the text file, delete the specified entry, save the file, and then run the "newaliases" command?
Thanks for any help!