sed cannot find file
<p>I'm using sed in a bash script to change some variable values. These variables are mixture of different types and include also some special characters:</p>

<pre><code> sed -i -e "s/NPROC=[^,]*,/NPROC=$NPROC/" \
      -e "s/NFRPOS=[^,]*,/NFRPOS=$OUTPUTFREQ/" \
      -e "s/NFRHIS=[^,]*,/NFRHIS=$OUTPUTFREQ/" \
      -e "s/COSP_OUTPUT_FREQUENCY=[^,]*,/COSP_OUTPUT_FREQUENCY=$OUTPUTFREQ/" \
      -e "s/TSTEP=[^,]*,/TSTEP=$TSTEP/" \
      -e "s/NCEXTR=[^,]*,/NCEXTR=$NCEXTR/" \
      -e "s/NVXTR2=[^,]*,/NVXTR2=$NVXTR2/" \
      -e "s/NVEXTR=[^,]*,/NVEXTR=$NVEXTR/" \
      -e "s/COSP_NLEVELS=[^,]*,/COSP_NLEVELS=$NLEV/" \
      -e "s/NVEXTRAGB=[^,]*,/$NVEXTRAGB/" \
      -e "s/NVEXTR2GB=[^,]*,/$NVEXTR2GB/" \
      -e "s/NFPLEV=[^,]*,/NFPLEV=$NFPLEV/" \
      -e "s/CNMEXP=[^,]*,/CNMEXP=\"${EXPID}\"/" \
      -e "s/LFPOS=[^,]*,/NFPOS=2/" \
      -e "s/NLAT=[^,]*,/NLAT=$NLAT/" \
      -e "s/NLON=[^,]*,/NLON=$NLON/" \
         $NAMELIST


+ sed -i -e 's/NPROC=[^,]*,/NPROC=10/' ' '
sed: can't read  : No such file or directory
</code></pre>

<p>However, I keep getting the error that the file $NAMELIST cannot be found. The file does exits in the same directory and there is no error in the name. Adding the fullpath doesn't help either. So I'm wondering what is wrong in this sed command.</p>