Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, March 1, 2022

Insert a new line at the beginning of a file

 Here's a way to add a line to the beginning of a file:


sed -i '1s!^!set timing on\n set time on\n set echo on\n!' batch1.sql_bkp

find . -type f -name '*.sql' -exec sed -i '1s!^!set timing on\n set time on\n set echo on\n!' {} \;


sed -i '1s/^/line_to_be_added\n/' file

Then, you could use the code above with find to achieve your ultimate goal:

find . -type f -name '*.js' -exec sed -i '1s/^/line_to_be_added\n/' {} \;

Database Options/Management Packs Usage Reporting for Oracle Databases 11.2 and later (Doc ID 1317265.1)

  Database Options/Management Packs Usage Report You can determine whether an option is currently in use in a database by running options_pa...