[K12OSN] OT: Bash help

Les Mikesell les at futuresource.com
Tue Nov 20 03:19:14 UTC 2007


Peter Hartmann wrote:
>> First, if you need arrays, you should probably think perl and hashes
>> instead of shell and counters, 
> 

> I'm not sure what the resulting code looks like...  But I'll tell you
> that I need to preserve blank lines in my textfiles.  Some of the ways
> I tried to assign a texfile to an array removed those blank lines.
> 
> Guess I'll be studying perl......

Does the shell really need to parse the values in your files or are you 
just slicing and dicing lines/fields into different files?  If the 
latter, you might be able to use sed and/or cut/paste/comm/sort, etc. 
(the traditional unix toolset) instead of reading to shell variables. 
Awk can do more than that, but if you need awk you might as well just 
use perl in the first place.

-- 
   Les Mikesell
    lesmikesell at gmail.com







More information about the K12OSN mailing list