[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

shell script experts pls help a lost soul


I am having some problems creating some sample scripts...hoping that somebody can lend a helping hand.

if test -x $1
then whoami;
echo $1

Yes I know my script sucks but I'm just learning..anyway, my questions are:

1. my script doesn't seem to display the script name together with whoami..actually, what the script was supposed to do is when it is invoked, it will display the user name together with the scriptname should the scriptname gets changed somehow..it displays the username but not the scriptname itself.

2. how do I add to this script the count of the number of lines in a file? i.e. let's say cat's man page.

3.lastly,let's say I want to print the first line of each 3-char.h file in /usr/include/lib..how can I accomplish this?

and Yes, this is part of my assignment but any ideas/help would be very valuable since I don't know anymore what to do...

please help me, you were all beginners once...

TIA, :)
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply to: