This small script can be used to manipulate a number of files in a directory to add text after certain lines that match a pattern.
This example will make the cursor visible in Meego's handset applications when run in /usr/share/applications directory.
#meego #regexp #sed #bash
for i in *.desktop ; do
sed -i '/^Exec=/s|$| -show-cursor|' $i;
done