Click to See Complete Forum and Search --> : Getting text line by line in a BASH -script


Nalle
06-17-2001, 11:11 AM
Now, I'm in the process of creating a script (this one: http://nalle.eller.no/fixlog-0.5.tar.gz ) that is supposed to take care of the logfiles in /var/log/.

The goal is to gzip them and moving them to a backup directory (/var/log/oldlogs/logs.[date]. Gzipped they will be small, and both readable and searchable with 'less'


In order to make the script run as a cron job, I need to be able to make a file that line by line is read into the script and also processed line by line. It's far easier for the user than having one cron job for each file you want processed.

Now, I've got the lay-out of the thing clear, it's just to find a syntax to loop through a file, line by line, adding that when executing in next loop.

I hope somone sit with the answer to this one, since I can't find it.

X_console
06-17-2001, 12:51 PM
Moving this to the Programming Forum. Maybe someone will be able to answer your question there.