I'm new to Bash and I'm trying to learn how to firstly execute two commands using the | symbol, and secondly how to join two commands into a compound command.
When writing two commands in one line the pipeline symbol | is meant to connect the output of the first command to the input of the second. So I don't quite understand how it fails to join "Hey" and ", how are you?".
echo "hey" | echo ", how are you?"
When writing a compound command, commands should be between the opening and closing braces separated by a semicolon. In this case
{ echo "Hey"; echo ", how are you" }
, but it doesn't seem to work as expected.
What could I be missing out here, for these two cases?