Linux / UNIX Tech Support Forum
This is a discussion on Shell script or code for deleting a user within the Shell scripting forums, part of the Development/Scripting category; hello i think this post doesnot have any meaning but as a newbie i need it .. so please help ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hello
i think this post doesnot have any meaning but as a newbie i need it .. so please help me i have made a script for adding a user (USiNG LINUX FEDORA 6) now i want to delete the user . could any one help me in writing the script .. in the adding user program i have given permission as 777 for user & root crated a home directory for user and givne him a password.. |
| Sponsored Links | ||
|
|
|
||||
|
Pretty simple
Code:
#/bin/bash read -p "Enter a User name to delete : " UNAME grep $UNAME /etc/passwd >/dev/null [ "$UNAME" == "root" ] && exit 1 || : if [ $? -eq 0 ] ; then deluser $UNAME echo "User $UNAME has been deleted" else echo "User $UNAME not found" fi
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell code for Restoring cpmove accounts(bulk amount) | vivekv | Shell scripting | 2 | 03-12-2007 09:56 PM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 08-10-2007 12:36 AM |
| How can i create script for deleting user? | Paul | Shell scripting | 1 | 02-08-2007 10:20 PM |
| script for mailing to user the o/p of the script | ricc | Shell scripting | 3 | 11-07-2007 04:59 AM |
| How to change the login shell for Linux user | chimu | Getting started tutorials | 0 | 26-01-2007 07:20 PM |