Script Entry to block 9 characters userid


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script Entry to block 9 characters userid
Prev   Next
# 1  
Old 10-17-2013
Script Entry to block 9 characters userid

Hi Guys,
I have one script which is used to add new user in the system.
This is how we add new user in system:-
Code:
 sudo /opt/local/bin/new-user 114 ranivarm "Rani Varma(Libo Technical User)" INC00001111

Where
114:-is the site id
ranivarm:- is userid
"Rani Varma(Libo Technical User)" :- comment
INC00001111:- ticket number
The script is little big, so here is part of that script:-
Code:
case $steps2skip in
(help)  die "$advanced";;
(password)      steps2skip=124;;
(enable)        steps2skip=123;;
([1-4]*)        ;;
esac
username=${1:?username required: $usage} shift
ticket=$3
descr="$*"

#
# assertions
#
grep -c ${group}  /etc/group >/dev/null ||
        warn "Warning: group $group is not in /etc/group"
grep -c $shell /etc/shells >/dev/null ||
        warn "Warning: shell $shell is not in /etc/shells"
 
warn "Checking accountname ${username:?}"
if [[ $steps2skip = *1* ]]; then
        /bin/logins -xol $username ||
                die "account $username does not exist!"
        /bin/getent passwd ${username} ||
                die "account $username does not exist!"
        eval home=~${username}
else    : step 1: creating /etc/passwd entry
        /bin/getent passwd ${username} &&
                die "account $username already exists!"
        /bin/logins -xol $username

Could you please tell me what entry should I enter and where should I insert it?
Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cron entry to pass the value to script

0 I have a script(main.sh) which calls another script(Get_Files.sh) and gets a value in a variable like the below: File_to_Refresh="$(sh /Aug/work/Get_Files.sh /Aug/Work/Universal_File.txt)" Now I have to schedule the script main.sh for 3 different files i.e. the Universal_File.txt with 3... (2 Replies)
Discussion started by: bhartiya007
2 Replies

2. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies

3. Shell Programming and Scripting

awk script to call another script based on second column entry

Hi I have a text file (Input.txt) with two column entries separated by tab as given below: aaa str1 bbb str2 cccccc str3 dddd str4 eee str3 ssss str2 sdf str3 hhh str1 fff str2 ccc str3 ..... ..... ..... (1 Reply)
Discussion started by: my_Perl
1 Replies

4. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

5. Shell Programming and Scripting

Automatic su password entry script

Before I start, two things. 1) Yes I know it's bad practice and obomination to all things holy, but I'm not a sys admin at JP Morgan, I'm a hobbyist tooling about in a VM, in my pants, at home. 2) If you are just going to flame for even considering hardcoding a root password, thanks, I get... (2 Replies)
Discussion started by: 3therk1ll
2 Replies

6. Shell Programming and Scripting

mapping userid to an email in script

i have about 20 different users submitting a web form that executes a unix script in the background that sets EXECUTIONUSER to their unix id. i would like to use $EXECUTIONUSER to set their email address as EMAILADDR. of course their unix id does not match their email name either. for example: ... (3 Replies)
Discussion started by: crimso
3 Replies

7. Shell Programming and Scripting

FTP automation with special characters in userid

Hi, i am trying to automate an ftp script which is as below.But my user id has special characters(aaa\$ifg). So it is not working correctly.Can anyone help on this?I tried providing both of them in double & singe quoted. But somehow it is not picking the "\". Also tried keeping \ before the... (3 Replies)
Discussion started by: aeroticman
3 Replies

8. Solaris

How do I configure sendmail to block all OUTGOING mail FROM one userid TO the world?

Hello, ENVIRONMENT: OS: Solaris 10 Sendmail: 8.13.8+Sun BACKGROUND: We had a user account that was compromised and was used as a relay. She sent out (or would have if we didn't kill sendmail) ~10K emails alerting people they just won $75K. The target for this spam was everyone internal... (1 Reply)
Discussion started by: avikb
1 Replies

9. Shell Programming and Scripting

Script to find systems logged in with a particular userid

Hello All, I need to design a script to get all the systems names(IP Addresses) logged in with a particular userid say 'xyz' from different terminals. This is to track the use of the particular userid and take action if it is being misused. The script would accomplish the following steps: 1.... (1 Reply)
Discussion started by: mehimadri
1 Replies

10. Shell Programming and Scripting

Script for data entry

Hello everyone. I just registered like 17 minutes ago and am new to UNIX/Linux. I work in a small department of an animation company that does compositing tricks to fix movie frames. After our work is completed we are tasked with creating a text log that has information on what work we had... (7 Replies)
Discussion started by: AndrewP
7 Replies
Login or Register to Ask a Question