Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Idiom for booleans



On Sat, 13 Aug 2011 07:26:53 +0200
Micah Elliott wrote:

> So the buggy (or just bash-aware) python utility isn't going to work
> with zsh.

FWIW, I've been using this (put in my .zshrc), and never had any
problems (the (()) thing works as expected):

# from /etc/bash.bashrc, handle -> handler
if [ -x /usr/lib/command-not-found ]; then
  function command_not_found_handler {
  # check because c-n-f could've been removed in the meantime
  if [ -x /usr/lib/command-not-found ]; then
    /usr/bin/python /usr/lib/command-not-found -- $1
    return $?
  else
    return 127
  fi
}
fi

-- 
Štěpán



Messages sorted by: Reverse Date, Date, Thread, Author