Link to home
Start Free TrialLog in
Avatar of rdr2004
rdr2004

asked on

replace the values in template for the variables

I am tring to write a shell script to generate daily html report. I have a report template file with variable names, prefixed with $ sign, like $ID, $SERVER $JOB etc. I want to create a report file with the values passed on to it. I tried cat and sed command. They do not replace the values of the variable. They just print as it is. I wuold like to keep the template file seperate from the script file which gets the values for the variables. Thank you in advance. -- Raj
ASKER CERTIFIED SOLUTION
Avatar of ecw
ecw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rdr2004
rdr2004

ASKER

ecw,
Thank you for the code. This works and if it is very few variables and I am creating report with variable which changes every time and each line of the report. It got very much complicated to keep them seperately. Hence I put the code and the template in one file. It works. Thanks.
- Raj
Avatar of rdr2004

ASKER

ecw,
Thank you for the code. This works and if it is very few variables and I am creating report with variable which changes every time and each line of the report. It got very much complicated to keep them seperately. Hence I put the code and the template in one file. It works. Thanks.
- Raj