Multiple files editing



First of all thanks to birre, Rich Leitner and J.O. Aho for their responses, it gave me something to think about and better define my reasoning.
As a reminder I have to make changes to a large set of files. These changes would be small (a line or so), but, and this is an added constraint, one of the changes (applicable to the whole set of files) would be a command whose argument would depend upon the preceding / following line.

Ok, to be explicit : I am changing a set of DOS batch files that makes calls and things. I need to know what is going and found that the best way was to create a log file. This file is fed by "echo" statements whose arguments are basically the date and what file we're in.
I did this for 80-odd files, manually, for I thought that would be the end of it. However some bat files call others etc ... who call fortran exe, that do other things, and basically my original idea becomes a tad too simple.

So, from a bat file containing :

call something

I wish to replace it by :

echo (options) something >> logfile
call something
echo (options) out of something >> logfile

If there was a way to log call errors as well, life would be nice.

It seems DOS is a little poor in terms of utilities. I could write a fortran proggy but if there was a simpler way under linux, which is often the case, that would be nice.

Hope this is clear.

Thanks for any advice / help

GT
.



Relevant Pages

  • Re: Multiple files editing
    ... echo out of something>> logfile ... Python runs just as well in Windows, and there is also a DOS version. ... "ik _heb_ niets tegen Microsoft, ...
    (alt.os.linux)
  • Re: Multiple files editing
    ... echo out of something>> logfile ... you have a few more options with a real shell. ... Never take for granted that the script is run from the current directory ...
    (alt.os.linux)
  • Re: Batch files
    ... I have a few questions re Bat files in Windows XP. ... Remove the "pause" command from your batch ... @echo "Now backing up Search Database, ...
    (microsoft.public.windowsxp.general)
  • Re: Best way to Collect Log
    ... echo ......>>LOGFILE. ... In a Bourne or POSIX script: ... exec 3> LOGFILE ... and then every standard output of every command (including echo ...
    (comp.unix.shell)
  • Re: echo in cronjobs
    ... R> echo "comment">>$logfile ... R> When i run the same script using cron the comment is written to the ... R> $logfile, but every echo seems to create an entry in the mailbox with: ... stty when the process has a controlling terminal. ...
    (comp.unix.aix)