At 10:29:12.99 on 26-FEB-2003 in message <[EMAIL PROTECTED]>, Chris Johnson <[EMAIL PROTECTED]> wrote:
>Small flaw in my previous example of using "tr" -- it deletes ALL newlines, >which would not be a good thing to end up with a usable file. Do not use it >as written. sed, awk or perl might be a better choice. > >Sorry, haven't had my coffee yet. > >..chris > >> -----Original Message----- >> [mailto:[EMAIL PROTECTED] Behalf Of Michael T. Davis > >> I'll be the first to admit I'm not an UNIX guru. For readability, >> we'd like to format our IPF rules file so that, for files longer than would >> normally fit on the screen, we'd use line continuation characters to "wrap" >> the lines, e.g.: >> >> ...a very long line that is \ >> continued on one \ >> or more lines >> >> Is there a filter (using Perl, awk, etc.) that could be applied to the rules >> file which would allow IPF to accept it (i.e. join the continued lines)? > > Yeah, I thought that looked fishy. I've tried a few different sed invocations, which seems the most capable, but I'm just not getting it. I hadn't checked before sending my original request, but Perl, unfortuantely, isn't an option, since most "extras" weren't installed to conserve file space. (The system only has 64MB of file space, provided by an ATA Flash card.) My first attempt went line this: sed 's/ \\$//' ipf.rules That only removed the trailing backslash. According to the sed man page, lines of input are normally read in up to the terminating newline character "...unless there is something left after a `D' function..." So, I tried using the `D' function: sed '/ \\$/D' ipf.rules This ended up deleting the entire content of lines with terminating backslashes. I would think this would have been a pretty simple task to implement, but it's becoming increasingly frustrating. Help! Thanks, Mike -- Michael T. Davis | Systems Specialist: ChE,MSE E-mail: [EMAIL PROTECTED] | Departmental Networking/Computing -or- [EMAIL PROTECTED] | The Ohio State University http://www.er6.eng.ohio-state.edu/~davism/ | 197 Watts, (614) 292-6928
