Skip to content

Commit

Permalink
Escape '&' in sed commands
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Jun 7, 2024
1 parent 670a7ef commit 2d94656
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/exgfs_wave_post_pnt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,14 @@ source "${USHgfs}/preamble.sh"
then
export dtspec=3600.
# Construct the wave_outp_spec (spec) command to run on each buoy in buoy_lst.txt
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_spec.sh \1 ${ymdh} spec ${escaped_SPECDATA} > ${escaped_SPECDATA}\/spec_\1.out 2>&1/" buoy_lst.txt >> "tmpcmdfile.${FH3}"
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_spec.sh \1 ${ymdh} spec ${escaped_SPECDATA} > ${escaped_SPECDATA}\/spec_\1.out 2>\&1/" buoy_lst.txt >> "tmpcmdfile.${FH3}"
fi

if [ "$DOBLL_WAV" = 'YES' ]
then
export dtspec=3600.
# Construct the wave_outp_spec (bull) command to run on each buoy in buoy_lst.txt
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_spec.sh \1 ${ymdh} bull ${escaped_SPECDATA} > ${escaped_SPECDATA}\/bull_\1.out 2>&1/" buoy_lst.txt >> "tmpcmdfile.${FH3}"
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_spec.sh \1 ${ymdh} bull ${escaped_SPECDATA} > ${escaped_SPECDATA}\/bull_\1.out 2>\&1/" buoy_lst.txt >> "tmpcmdfile.${FH3}"
fi

split -n l/1/10 tmpcmdfile.$FH3 > cmdfile.${FH3}.01
Expand Down Expand Up @@ -513,13 +513,13 @@ source "${USHgfs}/preamble.sh"
if [ "$DOSPC_WAV" = 'YES' ]
then
# Construct wave_outp_cat (spec) call for each buoy in buoy_lst.txt
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_cat.sh \1 ${FHMAX_WAV_PNT} spec > ${escaped_CATOUTDIR}\/spec_cat_\1.out 2>&1/" buoy_lst.txt >> cmdfile.buoy
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_cat.sh \1 ${FHMAX_WAV_PNT} spec > ${escaped_CATOUTDIR}\/spec_cat_\1.out 2>\&1/" buoy_lst.txt >> cmdfile.buoy
fi

if [ "$DOBLL_WAV" = 'YES' ]
then
# Construct wave_outp_cat (bull) call for each buoy in buoy_lst.txt
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_cat.sh \1 ${FHMAX_WAV_PNT} bull > ${escaped_CATOUTDIR}\/bull_cat_\1.out 2>&1/" buoy_lst.txt >> cmdfile.buoy
sed "s/^\(.*\)$/${escaped_USHgfs}\/wave_outp_cat.sh \1 ${FHMAX_WAV_PNT} bull > ${escaped_CATOUTDIR}\/bull_cat_\1.out 2>\&1/" buoy_lst.txt >> cmdfile.buoy
fi

if [ ${CFP_MP:-"NO"} = "YES" ]; then
Expand Down

0 comments on commit 2d94656

Please sign in to comment.