ash: "source <nonexistent file>" makes ash exit?

Bernd Petrovitsch bernd at petrovitsch.priv.at
Mon Mar 18 09:38:36 UTC 2013


Hi!

On Mon, 2013-03-18 at 10:09 +0100, Bastian Bittorf wrote:
> * Joshua Judson Rosen <jrosen at harvestai.com> [18.03.2013 09:58]:
> > failure to dot/source a file can still result in an error-message without
> > making the shell quit. In order to do that, I had to slightly adjust
> 
> somebody posted a link to the posix-standard, where explicity is
> written, a shell must abort when a '. $file' fails. what is your
> usecase? why is a
> 
> [ -e "$file" ] && . "$file"
> 
> not ok for you? my usecase was more a "speed" issue, because

The only technical reason against that is the race condition if $file is
deleted after the existence/read check.
Well, since the standard wants that ....

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at



More information about the busybox mailing list