Bourne Shell Script that only takes command l

March 25, 2010 at 06:51:14
Specs: Windows XP
Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script?

The output should be something like this:

User userid has a home directory of: /path/directory
the default shell for this user is: /path/shell

See More: Bourne Shell Script that only takes command l

Report •

March 25, 2010 at 07:04:48

Report •

March 25, 2010 at 07:09:19
Thanks for the quick reply wollie.
I'm relatively new at Unix Bourne Shell scripting. Could you please elaborate your response a bit?

Thanks heaps in advance.

Report •

March 25, 2010 at 07:31:21
I can help a bit. I'm pretty new at UNIX and scripting myself but I've used $HOME recently in a script.

Copy the following and paste it into a script and run it

echo "You are logged in as: $USER"
echo "Your home path is: $HOME"
echo "You are using the following shell: $SHELL"

Scripting is not my forte. Neither is programming. But I try. I'm not sure I understand about you wanting to use the username as part of the command line. Perhaps if you explained what it is you're trying to do, someone more adept than myself can give you a simple method for achieving what it is you wish to do.

Report •
Related Solutions

Ask Question