Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Feb 2009 10:09:03 +0100 (CET)
From:      Wojciech Puchar <>
To:        Adam Vande More <>
Subject:   Re: insert new line in files
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> I want to insert a new line of text at a certain position in certain files 
> recursively under a directory.  More specifically, I want text like this:
> include('/usr/home/www/imp-sites/default_inventory.php');

write a script:

while [ $a -lt 36 ];do
  read line
  echo "$line"
echo "include('/usr/home/www/imp-sites/default_inventory.php');"
while read line;do
  echo "$line"
done) <$1 >/tmp/$$
mv -f /tmp/$$ $1

run it over each file

Want to link to this message? Use this URL: <>