JSchmitz has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to automate the process of adding users to sendmail (the commercial version) via command line. I am using "system" to run the commands inside the script but need to open a file and read in about 1200 user ID's. Would I use STDIN? or set up a loop that just reads the user ID over and over again?
#!/usr/bin/perl -w #move to the right directory system("cd /usr/local/sendmail/smmstore-1.0.0/sbin ./msadm_tclsh") #set the domain system("msadm> domain_set blah.blah.com") #add the user system("msadm> mbox_user_add antivroom")

Replies are listed 'Best First'.
Re: Adding Users to Sendmail
by JSchmitz (Canon) on Oct 17, 2001 at 01:36 UTC
    Alright I guess I can just do this.....
    #!/usr/bin/perl -w #move to the right directory system("cd /cd /usr/local/sendmail/smmstore-1.0.0/sbin ./msadm_tclsh") #set the domain system("domain_set houston.westerngeco.slb.com") #add the user system("mbox_user_add jdoeusr") open (IN, "<users.txt" ) || die ("Cant open users.txt"); while(<IN>) { chomp; system("mbox_user_add $_"); }