Write a BASH/C shell script which takes a name of a directory as a command line argument, and prints unique login name of the users having files in that directory. Your code should perform appropriate error checking.
A sample output is:
$sh name.sh /etc
mysql news root uucp