env and start.env that should run in any shell.
It actually does except for KORN where env variable setting is not behaves the way I would expect. So look at example.
file set.env :
export MY_VAR="home" || setenv MY_VAR "home"
command . ./set.env || source set.env
ksh$ echo $MY_VAR
When you run
start.sh, you're executing it as a subcommand, not sourcing it. Consequently, changes it makes to environment variables are scoped to that process and its children; once the process exits, the environment variables it sets die with it.
To portably source the script, executing it in your current shell and thus setting environment variables within that shell, run:
# this works on any POSIX shell, including ksh (and bastardizations such as mksh) . start.sh
...or, less portably:
# this is a bashism source start.sh
BTW, as a practice,
command . ./set.env is... odd.
command prevents execution of shell functions, but any environment where a function named
. is defined is arguably a buggy environment. Consider
. start.sh alone.