I need to append the following code to the end to all the php files in a directory and its sub directory:
</div> <div id="preloader" style="display:none;position: absolute;top: 90px;margin-left: 265px;"> <img src="ajax-loader.gif"/> </div>
I have tried with
echo "my text" >> *.php
But terminal showed the error:
bash : *.php: ambiguous redirect
What should I do. there are hundreds of files to add this code segment and it would be a real tough time adding it in each file. Thanks in advance.
Append Text Using >> Operator The >> operator redirects output to a file, if the file doesn't exist, it is created but if it exists, the output will be appended at the end of the file. For example, you can use the echo command to append the text to the end of the file as shown.
I usually use tee because I think it looks a little cleaner and it generally fits on one line.
echo "my text" | tee -a *.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With