Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Use command grouping {}. Commented Sep 22, 2014 at 16:16
  • If your goal is When installChruby returns an error, print the error message and exit, so using [[ $CHRUBY =~ [Yy] ]] && installChruby || die "Error installing chruby" will work as you expected. Commented Sep 22, 2014 at 16:18
  • @Gnouc yes, but it also exits when CHRUBY is set to something else (like N or n), which is not what is wanted. Commented Sep 22, 2014 at 16:20
  • More generally, see stackoverflow.com/questions/6270440/… Commented Sep 23, 2014 at 22:53
  • Related: unix.stackexchange.com/q/247187/135943 Commented Dec 3, 2015 at 21:23