You are on page 1of 1

CSE-321 Enterprise Network Technologies Assignment # 3

1. You have a file named users. Each line in the file contains two words (space separated): a user name and a group name. Write a (Perl or Bash) script to: 25 Marks a. read one by one each line in the file b. check if the group exists, add the group if it does not exists c. check if the user exists, check the user belongs to the same group, if not change the group. Add user to the group if user does not exists d. Set the password of the user same as the username. e. On each step, display appropriate prompts (e.g., user added, user already exists etc.) 2. Write a (Perl or Bash) script which takes one or more filenames as arguments. If any of the files does not exist in the current directory display prompt. For each file, remove all the comments lines in the file. 25 Marks 3. What is difference between su and sudo? How can su be used instead of sudo for getting access to root privilege? 15 Marks 4. Modify your shell, such that every time you enter clear, it clears screen and on top of new screen displays Welcome . You are using . Today is . Where is the name of the user logged in, is the path to the shell you are using and is current date and time. 15 Marks 5. How can you check if your Linux machine on network has static or dynamically allocated IP? How can you change it from dynamic to static? 20 Marks
e m i t _ d n a _ e t a d l l e h s l l e h s e m a n r e s u e m i t _ e d n m a a _ n r e t e a s u d

Notes: 1. Write short scripts and include brief explanation of commands used. Add screen shots to show the working of the script. 2. Solution has to be provided in both soft and hard copies by respective deadlines. 50% marks deduction if you submit only one of them OR if both copies do not match. Name, Reg. No and Section should be mentioned on both the copies. 3. Deadline to upload softcopy: 3 pm on 4th January, 2012 4. Submit hardcopy: In class on 4th January, 2012 (Sec. B) & In class on 5th January, 2012 (Sec. A) 5. Commands/Theory covered in the assignment will be part of quizzes/exams.

You might also like