[KLUG Members] To shell or not to shell...

Orien Vandenbergh members@kalamazoolinux.org
Mon, 8 Jul 2002 11:54:59 -0400


Since your goal is to process text, might I suggest using perl?  That
way, you aren't stuck doing text processing in C, but you have
considerably more power and flexibility than a bash script.  

If you need/want help or pointers in that direction, just let me know.

Orien

On Mon, 08 Jul 2002, Gettig,Tony wrote:

> I hold firm the belief that every network guy is a
>  frustrated programmer and vice versa. Same holds true for
>  guitar players and drummers. Please bear with me, as I am
>  more of a network guy. :)
> 
> I need to take an export file, and process it to two
>  different output files. The file is currently in a fixed
>  width, one record per line format. It needs to go to an
>  LDIF file and a DOS batch file, both of which are plain
>  text.
> 
> I'm trying to figure out how I can process this export file
>  one line at a time in a shell script, but I'm starting to
>  think I can't. I'm thinking I need to write a little C
>  program to read each line into an array, walk through it
>  as necessary, and write out to the text files. I'd rather
>  do it with bash, but am failing to find how. Everything I
>  read about I/O with shell scripts is just redirection.
>  Nothing on how to open a file for reading line by line.
> 
> Ideally, I will be able to cron this thing and come to work
>  in the morning after the magic has happened.
> 
> Any ideas or pointers in the right direction are
>  appreciated!
> 
> Tony Gettig
> http://www.penguindude.com
> GBY!
> _______________________________________________
> Members mailing list
> Members@kalamazoolinux.org
>