In Short
Is there some way to bash command line: echo "***some code***" >> "***all files of some type***"
right after the line in the files that includes a certain string such as <body
?
In Long
I have to add google analytics to a site. Its got an archive of stuff that goes by a few years.
For some recent archived years I just added :
...
</head>
<body<?php if ($onpageload != "") { echo " onload=\"$onpageload\""; }?>>
<?php include_once("analyticstracking.php") ?>
...
into the common_header.php file
For some of the early stuff they didn't make a common_header.php file. So, for the folders that manage years that don't have common headers there are alot of html files that need this line:
<?php include_once("analyticstracking.php") ?>
Is there some way to bash command line: echo "<?php include_once("analyticstracking.php") ?>" >> "*.html"
right after the in the file that includes a certain string such as <body
The site is managed with php, python, and html (with some javascript css etc).
I am on ubuntu. Also note I am newer to this kind of webpage so if my question is somehow a wrong or a stupid question, please just let me know.