-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Arnold wrote:
> So now i have a need to insert ' at the beginning of text and at the
> end in over 2000 files. The text is always the same and is always found on 
> the first line
> of the files (there are over 2000 files). The text is
> ../../wp-blog-header.php and the finished text should look like
> '../../wp-blog-header.php'. How would i make a bash script to
> accomplish this or is it possible?

I could just be tired, or your request is ambiguous. I can't determine
if you just need to enclose the top line in single quotes in 2K files,
or _all_ lines in 2K files. I'm assuming here your files are in the same
directory.

In the first instance,

sed -i "1s/\(^.*$\)/'\1'/" input.txt

In the second,

sed -i "s/\(^.*$\)/'\1'/" input.txt

You just want to change the input.txt to a bash for loop which catches
all the relevant files.




JA


- --
http://www.DonAssad.com
jabber ID: [EMAIL PROTECTED]

Please consider the environment; do you really need to print out this
e-mail?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHOiYsFcf72sjD2+QRAnJ4AJ4u8516are7kHWmWkzPjZeNrY1BEwCcDCAD
ew/iAhxytdKCYtKkjyoG6f0=
=oIXY
-----END PGP SIGNATURE-----
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to