[aklug] Re: Shell scripting is fun

From: Royce Williams <royce@alaska.net>
Date: Sat Oct 25 2008 - 18:12:01 AKDT

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

-- 
Royce D. Williams                                   - http://royce.ws/
There are two ways to write error-free programs; only the third works.
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Oct 25 18:12:11 2008

This archive was generated by hypermail 2.1.8 : Sat Oct 25 2008 - 18:12:12 AKDT