From: short <> Date: Tue, 23 Mar 2004 18:22:43 +0000 (+0000) Subject: Fixed fatal error during 'getopts' invocation in .bashrc functions. X-Git-Tag: bp_liverpm~28 X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=c67aee3ca262299c60246e38069451502f8c5f43;ds=sidebyside Fixed fatal error during 'getopts' invocation in .bashrc functions. --- diff --git a/.bashrc b/.bashrc index 95a48dc..7cc89f9 100644 --- a/.bashrc +++ b/.bashrc @@ -22,7 +22,7 @@ function _bash_profile_addpath # , OPTIND=1;while getopts fs got;do case "$got" in [fs]) eval "_opt_$got=1" ;; - *) exit 1 ;; + *) return 1 ;; esac done eval "_varname=\"\$$[$OPTIND+0]\"" @@ -194,7 +194,7 @@ function revlines { perl -e 'my @r=();push @r,$_ while (<>);print pop @r while @ case "$got" in [qalf]) eval "_opt_$got=1" ;; v) ;; - *) exit 1 ;; + *) return 1 ;; esac done shift $[$OPTIND-1]