1819794 Members
3385 Online
109607 Solutions
New Discussion

variables in sed

 
Kris_5
Occasional Advisor

variables in sed

Hi Folks,

I have to substitute a variable for the line number in the sed command. But for some reason, it is not working. Can some one help me out. Thanks in adv.


$ deljob=aif
$ sed '/\/job_code=$deljob/,/^$/d' CronJob.job
# @purpose
# Prototype of job file that can be compiled into a crontab input
# file with a simple AWK program
#
/sid=ocbsd
/user=oppaps

/job_code=aif
/job_type=aot
/script=/opt/ORACLE/oclin/40/dev/aot/xibs/aif_exec.sh
/parameters=ocbsd ocnuq
/on_weekday=1-5
/on_hours=7
/retries=3
/on_mins=30

/job_code=clab
/job_type=aot
/script=/opt/ORACLE/oclin/40/dev/aot/xibs/clab_exec.sh
/parameters=ocbsd ocnuq
/on_weekday=1-5
/on_hours=9
/retries=6


Aif is still appearing in the output.

Kris
1 REPLY 1
Kris_5
Occasional Advisor

Re: variables in sed

Thanks guys, I figured it out.