Thursday 21 May 2015

Write a shell script which accepts valid log-in names as arguments and prints their corresponding home directories, if no arguments are specified, print a suitable error message.VTU MCA LAB 2B

echo "Enter user name"
read usr
grep -w "$usr" /etc/passwd | cut -d ":" -f 6

No comments:

Post a Comment