On Fri, Sep 16, 2011 at 5:14 PM, Bonno Bloksma <b.blok...@tio.nl> wrote: > >>> linbobo:~/sedtest# sed 's_\n<pre>\n_\n<pre>\n\n_' <original.txt >>> >new.txt linbobo:~/sedtest# less new.txt > >> You want to change the regexp here. In regular expressions '^' matches > start of line and '$' matches end of line. >> Your sed instruction above should be something like 's/^<pre>$/<pre>\n/', > or more generally 's/^\(<pre>\)$/\1\n/'. > > Ok, I've got most of it. The last part is more of a bash problem I think as > most of the files have spaces in them. Not my idea, it's how the files were > delivered to me. :-( > > So the command line: > for i in `ls *.txt` ; do ./add-pre-nl.sh $i; done > does not cut it as it chops the filesnames up and issues each part to the > add-pre-nl script. :-( > If I just use > ./add-pre-nl.sh file\ name\ with\ spaces.txt > it will produce the result I want.
Use "$i" for the filenames with spaces to remain whole. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/CAOdo=syhrd5sx1h6ftrbk46c++u8w2zbzndw7r+hvr0m7ku...@mail.gmail.com