[aklug] Re: Shell scripting is fun

From: Christopher Howard <choward@indicium.us>
Date: Sat Oct 25 2008 - 22:35:08 AKDT

Royce Williams wrote:
> Christopher Howard wrote, on 10/25/2008 7:28 PM:
>
>> Royce Williams wrote:
>>
>>> Christopher Howard wrote, on 10/25/2008 5:06 PM:
>>>
>>>
>>>> Hey, this shell scripting stuff doesn't seem to be as hard as I thought
>>>> it was going to be! And it's fun too!
>>>> echo -e "Name please:\c"
>>>> read myname
>>>> echo "$myname is a stupid name."
>>>>
>>>>
>>> Hello, Chris -
>>>
>>> Excellent! I've been looking for something that does this. ;-)
>>>
>>> What license is your new software distributed under? I'd like to submit a patch for possible inclusion in the main source tree.
>>>
>>> --- stupidname.sh 2008-10-25 17:59:07.000000000 -0800
>>> +++ stupidname.sh.new 2008-10-25 18:08:23.000000000 -0800
>>> @@ -1,3 +1,11 @@
>>> -echo -e "Name please:\c"
>>> +#!/usr/bin/bash
>>> +echo -e "Name please: \c"
>>> read myname
>>> echo "$myname is a stupid name."
>>> +
>>> +MOREUSERS=`cut -d\: -f5 /etc/passwd | awk '{print $1}' | egrep -v '^#'`;
>>> +
>>> +for othername in ${MOREUSERS}; do
>>> + echo "$othername is also pretty stupid."
>>> +done
>>> +
>>>
>>> Is there a CVS/Subversion/GIT repository somewhere?
>>>
>>> Royce
>>>
>>>
>>>
>> Har har har... okay, so I guess three lines of code doesn't exactly make
>> me a shell scripting guru. :)
>>
>> Heck, I'm not even sure how to use CVS yet. I tried once but couldn't
>> even get logged onto the server. (I think the server was down...)
>>
>
> I wasn't trying to make fun of you; just trying to riff on it a bit!
> I thought it would be funny to automate the stupid name calling. :-)
>
> And to my embarrassment, I've never actually gotten a proper handle on
> using 'read'; looks like I need to get back to some basics myself. ;-)
>
> Royce
>
>
Hey, did you guys know that "apt-get moo" was an actual command?
Apparently there is also similar command in aptitude:
http://www.ossblogger.com/2007/09/20/aptitude-moo-is-there-anymore-easter-eggs-for-linux-user/

-- 
Christopher Howard
choward@indicium.us
http://www.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Oct 25 22:37:39 2008

This archive was generated by hypermail 2.1.8 : Sat Oct 25 2008 - 22:37:39 AKDT