Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Ryusuke Nomoto
Added: Apr 27, 2018 3:51 PM
Views: 3
Tags: no tags
  1. function throw_error(){
  2.     ERRROR_MESSAGE=$1
  3.     return 1
  4. }
  5.  
  6. __command__ || throw_error "__error_message__"
  7.  
  8. もしくは
  9.  
  10. __command__ || { doSomething; return 1; }