ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does the script produce any messages when run providing clues to the reason the user was not deleted?
As usual, I would suggest reading the man page for userdel, but this is important:
Code:
man userdel
...
CAVEATS
userdel will not allow you to remove an account if there are running processes which belong to this
account. In that case, you may have to kill those processes or lock the user's password or account and
remove the account later.
Also guys I wanted to use a sed command in my script to change %sudo ALL=(ALL:ALL) ALL to %sudo ALL=(root) /usr/bin/apt-get
am i right to assume that you want to automate the editing of /etc/sudoers? being a confessed noob? you know that a broken sudoers means no sudo? are you sure this is a good idea? i'm not...
anyhow, other people have things to say about that: https://stackoverflow.com/questions/...-from-a-script
i suggest you read most of it, incl. comments, before continuing.
Hello ladies and gentlemen, can anyone tell me why sed in line 7 works on everything besides in the /etc/sudoers file? (e.g. I can make a file with %sudo All=(ALL:ALL) ALL; and it will change that, but it wont do it for /etc/sudoers). Also why in line 10 wont it modify line 9's command.. And one last thing, am I using the until loop correctly?
Last edited by justmy2cents; 05-15-2017 at 12:05 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.