On Wed, Nov 13, 2013 at 10:49:24AM +0800, David Adam wrote:
> > I also think ignoring errors should be explicit; the default should be
> > exit-on-failure (though I'll understand that it might be too late to change
> > due to backward compatibility)
> It would definitely have to wait for a new major release of fish, I think.

indeed. though i wonder what would be a good path to not surprise anyone
with such a change?

start with printing a warning now?
and educate users on how to write the script so that it doesn't crash?

(how would that look like btw? 
 false;                         # this would generate a warning first and cause 
an exit later.
 false; or true;                # this would catch the warning and error.
 false; or echo $status; true;  # handle the error)
 false; or exit;                # force exit, works now, will continue to work 
in the future.

add an option/setting equivalent to bash -e which will turn into a no-op
later, so that people can write scripts in a future-compatible way and
test whether such a change is even feasable.

also, how to check if there is actually a fatal error?
programs use the exit status to convey other information than just an
error. maybe this should only happen on the values given here:

http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF

1       Catchall for general errors    
2       Misuse of shell builtins (bash)
126     Command invoked cannot execute
127     "command not found"          
128     Invalid argument to exit    
128+n   Fatal error signal "n" 
130     Script terminated by Control-C (abd also by ctrl-z)
255*    Exit status out of range

this is more complex that it looked initially.

greetings, martin.
-- 
eKita                   -   the online platform for your entire academic life
hackerspace beijing     -                                    http://qike.info
--
chief engineer                                                       eKita.co
pike programmer      pike.lysator.liu.se                          caudium.net
foresight developer  realss.com                            foresightlinux.org
unix sysadmin        trainer           developer            societyserver.org
Martin Bähr          working in china        http://societyserver.org/mbaehr/

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to