[OS:N:] bash intro for high school students?

Jeff Kinz jkinz at kinz.org
Thu Jun 16 14:46:39 UTC 2005


On Thu, Jun 16, 2005 at 07:34:22AM -0700, Jay Scherrer wrote:
> On Thu, 2005-06-16 at 09:00 -0400, Jeff Kinz wrote:
> > Perl (while wonderful) is not designed to be used interactively.
> > You need one of the command shells for that.  One can try to use 
> > Perl as a shell, but it quickly becomes apparent that the need to have
> > everything be a complete program is much more awkward than the 
> > "command line" mode of the shells
> > 
> This is not true. 

Yes it is.

> My respected instructor, Dr. Tim Maher will be publishing a great book
> from Manning called "Minimal Perl" <http://manning.com/Maher> .
> Minimal Perl is an attempt to show readers the effectiveness of what
> Perl can do with as little as one line of code. 

Jay, while Perl one liners are wonderful things and can be very useful,
they are not as "minimally useful" nor as easy to use nor as easy to
understand as bash/sh command lines. (With all due respect to 
Dr Maher, because Perl is truly wonderful, no question) 

For example, word count on a file: "wc file"

Perl, of course, can do this in one line as well.  

Is it as easy to understand?  No

Is it as easy to type?  No

Inside the Perl shell can you go back to that line and edit it to
something more complex, like count how many lines begin with "it"
something like this?:

egrep -i "^it" < file | wc 

No.

Perl is wonderful.  Perl one-liners are great, but Perl is not a shell.
It lacks the features which make command shells the best place to use 
*NIX from.

I challenge you to try to stop using your command shell.
For one hour do everything from within Perl, or with only Perl
one-liners, using none of the command shell features (like command line
editing).  See if you feel like you have been more or less productive.



-- 
Jeff Kinz, Emergent Research, Hudson, MA.




More information about the open-source-now-list mailing list