#!/bin/bashNEW_TEXT=if failed Send to Karn KumarlOLD_FILE=$(awk '{print $1}' RMANJOBS | while read JB;do autorep -j $JB -q;done | egrep ^/|^insert_job|^description | sed '0~3 a\\')NEW_FILE=MRMANJOBSAWK='''    #.. Get new text from the shell variable.    BEGIN { NewText =   ENVIRON[TXT] \042; }    #.. If this line needs the fix, substitute the text.    /^description:.* [Ii]f failed / { sub (/ [Ii]f failed .*$/, NewText); }    #.. Print all lines, whether fixed or not.    { print; }    '''TXT=${NEW_TEXT} awk ${AWK} ${OLD_FILE} > ${NEW_FILE}Guys .. can anyone help me to sort the command output into a variable .. as its not taking for OLD_FILE.
Storing command output into a Variable in Bash
shell script
#!/bin/bashwhile read JB lastdo    autorep -j $JB -qdone < RMANJOBS |sed -rn /^\/|^insert_job|^description/{    s/(description:.* [Ii]f failed )[^]*/\1Send to Karn Kumarl/    s/insert/update/    p    } |sed '0~3 G' > MRMANJOBS