In my script I want to be able to write to either a file or to stdout based on certain conditions. I'm curious as to why this doesn't work in my script:
out=\&1
echo "bird" 1>$out
I tried different combination of quotes, but I keep having a "&1" file created instead of it writing to stdout. What can I do to get this to work how I want?