Project

General

Profile

« Previous | Next » 

Revision 9029

lib/sh/util.sh: try (): use simpler save_e instead of save_e_cmd

View differences:

lib/sh/util.sh
70 70

  
71 71
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try
72 72

  
73
function try () { "save_e_cmd" "$@" || true; }
73
function try () { e=0; "$@" || { save_e; true; }; }
74 74
alias try='declare e; try ' # last space alias-expands next word
75 75

  
76 76
catch () { test "$e" -eq "$1"; e=0; }

Also available in: Unified diff