Operating System - HP-UX
1836633 Members
1801 Online
110102 Solutions
New Discussion

Re: script to transfer users from SCO to HPUX

 
Amir Haboosheh
Frequent Advisor

script to transfer users from SCO to HPUX

hi guys,

i did my first script for adding all the printers (fun) to hpux but i am having issues figuring out the users.

we have about 200 users that i need their user_name, shell_dir and the content of the home_dir (.profile)


so i was thinking there must me a way to export the above to a space delimitated file:

example:
david /bin/sh

and a "david" dir will contain the ".profile" file.

then on the import side as each user is created with the correct name and shell the .profile will also me copied to the corrisponding folder.

any ideas?

thanks,
amir




1 REPLY 1
Michael Steele_2
Honored Contributor

Re: script to transfer users from SCO to HPUX

This shouldn't be too hard. How are you obtaining the information from SCO? Using the HP-UX /etc/passwd format:

grep /etc/passwd | awk -F: '{print $a $b $c $d $e $f $g }' | while read 1 2 3 4 5 6 7
do

useradd [-u uid [-o] ] [-g group] [-G group [, group...]] [-d dir] [-s shell] [-c comment] [-m [-k skel_dir]] [-f inactive] [-e expire] login

done

I would first list all logins in a file and cat it though

cat list | while read a
do

grep $a /etc/passwd | awk -F: ......etc.

See above to complete

done
Support Fatherhood - Stop Family Law