[CDBUG-talk] OT: script help

Patrick Muldoon doon at inoc.net
Wed May 12 09:17:45 EDT 2010

Try using the exec option to find as opposed to printing and pipe. While I do have sed on my phone :)  typing on the small keybaord is a bit rough. I pretty sure I have an example of this on my laptop...


--Patrick Muldoon
Network/Software Engineer

Typed with only my thumbs on a Palm Pre...
On May 12, 2010 9:07, Jonathan Franks <jonathan.franks at gmail.com> wrote: 

Hey guys,

I'm writing a little sed script to append a few lines to a file and I've run in to a problem. The script looks like this:

#! /bin/sh

find ./ -type f -name 'FileToFind' -print | while read i

 sed -i[bak] '$a\
stuff to append\
more stuff to append' $i

It works fine in testing, however in practice the absolute path to the file(s) contains a directory with a space in the name (Thanks, Apple...). 

Anyone know of a way to have the path sent to sed in quotes? 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org/pipermail/cdbug-talk/attachments/20100512/934d0aa0/attachment.html>

More information about the CDBUG-talk mailing list