Sponsored Content
Top Forums UNIX for Dummies Questions & Answers shell scripts to create 100 users Post 6215 by xiamin on Friday 31st of August 2001 10:38:37 AM
Old 08-31-2001
shell scripts to create 100 users

Hello

i need a shell script to create 100 users i am running hp-ux.........

startegy is something like this

craete a shell script
Code:
!/bin/ksh
counter=1
while [ $counter .le. 100 ] 
do
{
   useradd usr$counter
   passwd usr$counter
# here begins my problem when i say passwd usr$counter
#it again prompts saying retype new passwd..how do i handle #this situation
   counter=counter+1
}
done

regards
hrishy

added code tags for readability --oombera

Last edited by oombera; 02-19-2004 at 05:18 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP is using shell scripts create ? for file

ftp -n -v <<EOF verbose open 3.57.40.79 user infodvlp pr0gram ascii lcd /home/a501420038/GLA/Success_Load/ cd /ftp/SrcFiles/csg/InstruAsia/ get AU_Success_Log.txt close quit EOF Please help on this, this gives the out put "AU_Success_Log.txt?" As question mark in the last what will... (1 Reply)
Discussion started by: a501420038
1 Replies

2. UNIX for Dummies Questions & Answers

Scripts and changing users

Hi, I am writing somescripts to shut down some services in Korn Shell. Some of the services are under different owners. For example when I want to shutdown NXserver I need to be "root", but when I shut down the webserver I need to be under a different user. Manual I would use "su root" and... (1 Reply)
Discussion started by: bonekrusher
1 Replies

3. OS X (Apple)

interactive shell script to create users 10.4

Hello everyone, Not sure if this is the right place, but OS X isn't your standard Unix, so I figured here would be best. I am looking at creating a script that will be interactive that admins can run to create users. Now, 10.4 uses netinfo database and netinfo manager to handle it's users. ... (3 Replies)
Discussion started by: tlarkin
3 Replies

4. Shell Programming and Scripting

how to create and remove desktop icons from shell scripts

hi all how to create and remove desktop icons or icons from shell scripts? (1 Reply)
Discussion started by: kkpal
1 Replies

5. Shell Programming and Scripting

Create Bash shell scripts corresponding to windows bat files

Experts, I am newbie in shell scripting. I want to write Bash shell scripts corresponding to windows bat files. I have installed cygwin at c:\cygwin and i am trying to crate the sh file using vi editor. i am not able to understand how to use linux/unix convention for the code. following is my... (1 Reply)
Discussion started by: rajuchacha007
1 Replies

6. UNIX for Dummies Questions & Answers

shell scripts - create a filename with the date appended

I am looking to do something where if I created a file named backup,or whatever it would print a name like “backup_Apr_11_2011”. Thanks citizencro (1 Reply)
Discussion started by: citizencro
1 Replies

7. UNIX for Dummies Questions & Answers

shell scripts - list dead users accts and include a count at the end?

I am trying to show the number of dead accts or false shells running and include a count at the end. Does anyone know how to go about this? Thanks - citizencro (3 Replies)
Discussion started by: citizencro
3 Replies

8. Shell Programming and Scripting

How I can create this Shell scripts?

Hi friends you can solve my question about make 3 shell scripts? Thanks for all! (1 Reply)
Discussion started by: dakota
1 Replies

9. Shell Programming and Scripting

Create multiple users with individual passwords to users

hi, i am new to shell scripts i write a shell script to create multiple users but i need to give passwords to that users while creating users, command to write this script (1 Reply)
Discussion started by: DONFOX
1 Replies

10. Shell Programming and Scripting

Shell Script to filter users and create them again from a back-up server

This is a script to filter the users out of etc/passwd and etc/group. So if you want to migrate of restore a server you can use this script from a backup to restore and make the same users on you had.. Please feedback and comments. #!/bin/bash prompt_list () { # haal uit de argumenten de... (5 Replies)
Discussion started by: dannyvdberg
5 Replies
MouseX::NativeTraits::Counter(3pm)			User Contributed Perl Documentation			MouseX::NativeTraits::Counter(3pm)

NAME
MouseX::NativeTraits::Counter - Helper trait for counter attributes SYNOPSIS
package MyHomePage; use Mouse; has 'counter' => ( traits => ['Counter'], is => 'ro', isa => 'Num', default => 0, handles => { inc_counter => 'inc', dec_counter => 'dec', reset_counter => 'reset', }, ); my $page = MyHomePage->new(); $page->inc_counter; # same as $page->counter( $page->counter + 1 ); $page->dec_counter; # same as $page->counter( $page->counter - 1 ); DESCRIPTION
This module provides a simple counter attribute, which can be incremented and decremented. If your attribute definition does not include any of is, isa, default or handles but does use the "Counter" trait, then this module applies defaults as in the "SYNOPSIS" above. This allows for a very basic counter definition: has 'foo' => (traits => ['Counter']); $obj->inc_foo; PROVIDED METHODS
These methods are implemented in MouseX::NativeTraits::MethodProvider::Counter. It is important to note that all those methods do in place modification of the value stored in the attribute. set($value) Set the counter to the specified value. inc Increments the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount. dec Decrements the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount. reset Resets the value stored in this slot to it's default value. METHODS
meta method_provider_class helper_type SEE ALSO
MouseX::NativeTraits perl v5.14.2 2011-12-04 MouseX::NativeTraits::Counter(3pm)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy