[ale] Bash script question

Joseph Knapka jknapka at earthlink.net
Thu May 15 06:41:20 EDT 2003


Christopher Fowler <cfowler at outpostsentinel.com> writes:

> The problem is that bash isn't really made for this type of work.
> 
> > >comma_count=$(echo $line | tr -cd , | wc -c)
> 
> Sure, it may work above, but you are relying on external
> programs such as tr and wc to do some work for you.

Which is fine; after all the whole purpose of a shell script
is to wire together simple external tools, right?

>  Nothing
> I can tink of internal to bash will do this for you.  I've
> ran into problems of compatibility issues in the past using
> external commands to process strings.  

As long as the strings are plain ASCII, everything
should work. If you want to process binary data, a shellscript
is probably not the right thing to do.

Cheers,

-- Joe
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list