Avatar of David VanZandt
David VanZandt
Flag for United States of America asked on

How to edit a script to include the current pathname and filename - part 2 of 2

I'm tasked with adding a boilerplate header to several hundred existing scripts -- so that all *.sh and *.sql scripts will go forward with its purpose, change history, etc.

Part II:  I humbly ask for the sed/awk syntax that would allow me to:
1.  find a string in the header, such as '/u60/scripts...'
2.  replace that line with the pathname and filename, for example:
     --  /u02/common/scripts/start_backups.sql
Shell ScriptingLinux

Avatar of undefined
Last Comment
David VanZandt

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sweetfa2

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
simon3270

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
David VanZandt

ASKER
solution (in part) posted with the other question.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes