bash - How do I properly add a return character to this script? -
here script use run grunt "globally". in bash shell , wants more context wan return character bit more "silent" when run beast watch.
beast() { cd ~/root_install/grunt local a="$1" if [ $# -eq 0 ] grunt & fi if [ $# -eq 1 ] grunt "$a" & fi cd ~/root } i want return character @ part:
grunt "$a" & after &
when run grunt 1 of exit codes below.
- 0 - no errors!
- 1 - fatal error
- 2 - missing gruntfile error
- 3 - task error
- 4 - template processing error
- 5 - invalid shell auto-completion rules error
- 6 - warning
what can grab grunt "$a" &>/dev/null pick result using $?
so can if [ $? -eq 0 ] controls on return code.
&>/dev/null abbreviation 2>&1
it redirects file descriptor 2 , 1 (stderr & stdout) /dev/null
Comments
Post a Comment