hello. i have a script, but in solaris i get this message sed: illegal option -- i
whats wrong? With Ubuntu there is no problem. Thanks for help.
#!/bin/bash
for file in $(find /directory..../Test/*.txt -type f)
do
head -n 1 $file | egrep '^#!'
if [ $? -eq 0 ]
then
sed -i '2i\Headertext' $file
sed -i '1i\Headertext' $file
fi
done
Hello. Tank you. It works. But how can i make it possible, that the HEADERTEXT will be inserted in a directory and all subfolder . At the moment the script writes only in .txt files from directory Test.....