Subject: exit/return: /bin/sh in netbsd vs. /bin/sh in freebsd
To: None <netbsd-help@netbsd.org>
From: Lubos Vrbka <shnek@chemi.muni.cz>
List: netbsd-help
Date: 04/16/2003 16:08:07
hi guys,
i encountered following problem:
i have a set of shellscripts (/bin/sh) and use "return [value]" inside.
it works fine on netbsd, but one of my colleagues using freebsd has
problems with this. shell complains:
return can be used only in sourced scripts and inside cycles...
the situation looks as follows: script 1 calls other scripts (it just
executes them, variables are transferred via command line parameters)...
i.e. i don't source them...
i'd like to know what's the STANDARD behaviour? should it work, or
shouldn't? man sh tells the same thing about return both on netbsd and
freebsd machines...
i think i'll probably have to replace all returns by exits...
thanks for any help,
lubos
--
-
#################################################
Lubos Vrbka
National Centre for Biomolecular Research
Masaryk university, Brno, Czech Republic
shnek@chemi.muni.cz
http://www.chemi.muni.cz/~shnek
tel. +420 541 129 508
#################################################