How to send message to stderr in bash via echo command?

4

I'm writing some script to deploy an application and I need to send status messages to stderr instead of stdout , which the echo command does by default. How to do the command echo send the message to stderr instead of stdout ?

    
asked by anonymous 12.11.2014 / 21:32

1 answer

5

You can use the following command:

>&2 echo "erro"

or

echo Esta mensagem vai para o stderr >&2

Sources:
link
link

    
13.11.2014 / 01:56