-----------------------------Script--------------------------- echo "Enter the logname : " read lname uid=`grep $lname /etc/passwd | cut -d ":" -f 3` echo "User Id is : " $uid gid=`grep $lname /etc/passwd | cut -d ":" -f 4` echo "Group Id is : " $gid dwd=`grep $lname /etc/passwd | cut -d ":" -f 6` echo "Default Working Directry is : " $dwd dws=`grep $lname /etc/passwd | cut -d ":" -f 7` echo "Default Working directory is : " $dws -----------------------------output--------------------------- Enter the logname : mca114 User Id is : 680 Group Id is : 680 Default Working Directry is : /home/dca19 Default Working directory is : /bin/bash -----------------------------END------------------------------
Home
Shell Script
shell scripts for The file /etc/passwd contains info about all users. Write a program which would receive the logname during execution, obtain information about it from the file and display the information on screen in some appropriate format. (Hint : Use cut)
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
0 comments:
Post a Comment