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

[ale] Bash vs Perl



> From: "Jim Kinney" <jim.kinney at gmail.com>
> To: "Atlanta Linux Enthusiasts - Yes! We run Linux!" <ale at ale.org>
> Sent: Friday, October 21, 2016 8:00:46 PM
> Subject: Re: [ale] Bash vs Perl

> Parsing text in bash is much harder than in Perl. Associative arrays in bash
> really help.
Yes. I do know you can do regex, but those features come at the cost of portability. 

The biggest ding in bash over perl could be the expense of fork(). Using bash features that are not portable could recoup those. 

For those not following, text processing in shell is accomplished using a pipeline into other programs that my pipe into other programs. For small jobs this expense in minimal. Large jobs may not have the budget... 

When I use shell to do X and that X includes a database insert it is many times faster for me to just have bash create a SQL file and then I import that. The alternative is 1000s of fork then exec sqlite3 or mysql for each row. Just the nature of the shells. We have languages that can grab and maintain a database handle. 

> On Oct 21, 2016 6:33 PM, "Chris Fowler" < cfowler at outpostsentinel.com > wrote:

>> Not a rant or question, just a thought.

>> I've been working on "Jenga Linux" and since I do not have many perl modules
>> until later in the build of LFS 7.10 I'm sticking to bash as much as possible.
>> GNU STOW is an exception, but it uses perl in /tools from chapter 5 until it
>> can be installed in chapter 6. Beyond that , the only perl module in chapter 5
>> is XML::Parser. I could install all modules needed in /tools and use them in
>> chapter 6, but I'm forcing myself to expand my bash experience by using what
>> most other disti creators use.

>> It would nice to find a book titled: "Bash for Perl Programmers". Very simple
>> tasks I do in Perl are a struggle in bash. Stack Exchange is not short on
>> answers.

>> Chris

>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo

> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20161024/b5cb381b/attachment.html>