[CDBUG-talk] OT: script help
Jonathan Franks
jonathan.franks at gmail.com
Wed May 12 09:07:31 EDT 2010
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
do
sed -i[bak] '$a\
stuff to append\
more stuff to append' $i
done
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?
-Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org/pipermail/cdbug-talk/attachments/20100512/60aaf9c2/attachment.html>
More information about the CDBUG-talk
mailing list