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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -