Enter your email address & Win:

System Software Lab Programs ( UNIX Programs ) – 6a

// June 6th, 2009 // Educational, Engineering, Unix and System Software Lab // Written by sandeephegde

-->

Subject : System Software Laboratory

Branch : Information Science & Engineering

Semester : 6

University : VTU

[Click Here to get other programs by email ]

………………………………………………………………………………………………………………………….
PART -B

………………………………………………………………………………………………………………………….

6. a) Shell script that accepts valid log-in names as arguments and prints their corresponding home directories. If no arguments are specified, print a suitable error message.

if [ $# -eq 0 ]
then
echo -e “No arguments”
else
for a in $*
do
grep $a /etc/passwd>list
if [ $? -eq 0 ]
then
echo “Home dir of $a is :”
cut -c 20-46 list
else
echo “Improper login name $a”
fi
done
fi

[Click Here to get other programs by email ]


If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts:

  1. System Software Lab Programs ( UNIX Programs ) – 3a
  2. System Software Lab Programs ( UNIX Programs ) – 4a
  3. System Software Lab Programs ( UNIX Programs )
  4. System Software Lab Programs ( UNIX Programs ) – 2a
  5. System Software Lab Programs ( UNIX Programs ) – 7a
blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes