title: how to return from bash function with a message?
body: <p>I have a function which calls a command, when the command fails I have to echo a message and then return 1 to signal failure.</p>
  
  <p>EDIT: Sorry I don't remember how my attempt with if was, as other answers have pointed out, I might have done some silly mistake, so I'm removing it.</p>
  
  <p>This one works fine:</p>
  
  <pre><code>function F() {
    command || return 1
  }
  </code></pre>
  
  <p>but I need to echo message to signal reason for failure, so I tried this, even this doesn't return from function</p>
  
  <pre><code>function F() {
    command || (echo "message" &amp;&amp; return 1)
  }
  </code></pre>
  
  <p>Please suggest right way to do this.</p>