When I write:
echo 2*3>5 is a valid inequality
5
2*3 is a valid inequality
bash
does the oputput redirection first i.e. >
is done first and a file named 5
is created (or truncated if exists) and the resultant file descriptor remains open for the runtime of the echo
command.
Then the remaining portion i.e. 2*3 is a valid inequality
runs as the argument to echo
and standard output is saved in the file 5
eventually.
To get the whole string as STDOUT, use single or double quotes:
echo '2*3>5 is a valid inequality'