"ow to create and execute script"
This is Zameer Ahmed Syed... I would like write a script to create a new user .... i am a new one to unix and Linux... OSs .... if some body have script to create user then After Creating a script how to execute the script file ..... please send me in mail i would really appreciate if some body helps me regding this issue....
Optionally one morething i would like to know "what are the other interactive capabilities included in 'C' when compare with 'Bourne Shell'" Thanq very much.... Zameer Ahmed Syed, Hyd-India. |
Quote:
Quote:
|
Its very simple as described above also...
Create a file with lines of following format... username:password:uid:gid:comments:homedir:shell and issue the command... #newusers filename That's it. I have tested it here. If you are still getting errors,post contents of the file you created and the terminal output. Enjoy! __________________ Have a nice time.... Rajesh. |
Good Morning Rajesh,
Thanq for nice reply.... This is the file which i created .... in vi editor..... #!/usr/bin/newusers aaa111:x:510:510:'just for example':/home/aaa111/bin/newusers bbb111:y:512:512:'just for example':/home/bbb111/bin/newusers and after that i saved it and run the following command .... [root@redhat root]# newusers bulkusers then it gives me error message like newusers: line 1: invalid line newusers: line 2: invalid line newusers: line 3: invalid line [root@redhat root]# then i create new file ..... this time instead of newusers i use bash shell as follows... #!/usr/bin/bash aaa111:x:510:510:'just for example':/home/aaa111/bin/bash bbb111:y:512:512:'just for example':/home/bbb111/bin/bash then I saved it a file named "createallusers".. after that i run that file using bash shell like as [root@redhat root]# bash createallusers then it gives me following error message.... createallusers: line 2: aaa111:x:510:510:just for example: /home/ aaa111/ bin/ bash: No such file or directory createallusers: line 3: bbb111:y:512:512:just for example: /home/ bbb111 /bin/ bash: No such file or directory [root@redhat root]# what was the error .... i think it is PATH Error .... I don't know how to set to PATH.. If u know how to set to PATH plz tell me the procedure..... 1. To whom we have to set the PATH ......it is for user or some other bash file 2. Could you know How to link Different shells ... if so plz tell me the procedure. Thanq .... with regds, Zameer Ahmed Syed. |
Good Morning Rajesh,
Thanq for nice reply.... This is the file which i created .... in vi editor..... #!/usr/bin/newusers aaa111:x:510:510:'just for example':/home/aaa111/bin/newusers bbb111:y:512:512:'just for example':/home/bbb111/bin/newusers and after that i saved it and run the following command .... [root@redhat root]# newusers bulkusers then it gives me error message like newusers: line 1: invalid line newusers: line 2: invalid line newusers: line 3: invalid line [root@redhat root]# then i create new file ..... this time instead of newusers i use bash shell as follows... #!/usr/bin/bash aaa111:x:510:510:'just for example':/home/aaa111/bin/bash bbb111:y:512:512:'just for example':/home/bbb111/bin/bash then I saved it a file named "createallusers".. after that i run that file using bash shell like as [root@redhat root]# bash createallusers then it gives me following error message.... createallusers: line 2: aaa111:x:510:510:just for example: /home/ aaa111/ bin/ bash: No such file or directory createallusers: line 3: bbb111:y:512:512:just for example: /home/ bbb111 /bin/ bash: No such file or directory [root@redhat root]# what was the error .... i think it is PATH Error .... I don't know how to set to PATH.. If u know how to set to PATH plz tell me the procedure..... 1. To whom we have to set the PATH ......it is for user or some other bash file 2. Could you know How to link Different shells ... if so plz tell me the procedure. Thanq .... with regds, Zameer Ahmed Syed. |
All times are GMT -5. The time now is 04:06 PM. |