Hi,
I get in a bash script, in the follwoing line
echo $AAAA" "$DDDD" "$MOL_TAG >> ${OUPUT_RESULTS}
the error:
line 46: ${OUPUT_RESULTS}: ambiguous redirect
Why?
Thanks
Hi,
I get in a bash script, in the follwoing line
echo $AAAA" "$DDDD" "$MOL_TAG >> ${OUPUT_RESULTS}
the error:
line 46: ${OUPUT_RESULTS}: ambiguous redirect
Why?
Thanks
Do you have a variable named OUPUT_RESULTS
or is it the more likely OUTPUT_RESULTS
?
michael@isolde:~/junk$ ABC=junk.txt
michael@isolde:~/junk$ echo "Booger" > $ABC
michael@isolde:~/junk$ echo "Booger" >> $ABB
bash: $ABB: ambiguous redirect
michael@isolde:~/junk$
Does the path specified in ${OUPUT_RESULTS} contain any whitespace characters? If so, you may want to consider using ... >> "${OUPUT_RESULTS}"
(using quotes).
(You may also want to consider renaming your variable to ${OUTPUT_RESULTS}
;-))
put quotes around your variable. If it happens to have spaces, it will give you "ambiguous redirect" as well. also check your spelling
echo $AAAA" "$DDDD" "$MOL_TAG >> "${OUPUT_RESULTS}"
eg of ambiguous redirect
$ var="file with spaces"
$ echo $AAAA" "$DDDD" "$MOL_TAG >> ${var}
bash: ${var}: ambiguous redirect
$ echo $AAAA" "$DDDD" "$MOL_TAG >> "${var}"
$ cat file\ with\ spaces
aaaa dddd mol_tag