Date: Wed, 23 May 2007 10:17:49 +0200 From: "Ralf S. Engelschall" <rse@FreeBSD.org> To: current@FreeBSD.org Subject: etc/rc.d/{var,tmp} and sub-shell usage?! Message-ID: <20070523081749.GA18197@engelschall.com>
next in thread | raw e-mail | index | archive | help
I've just stumbled over a confusing sub-shell usage in our src/etc/rc.d/{var,tmp} scripts where I'm sure the sub-shells are totally unnecessary and useless. I also do not see any difference under run-time except that the sub-shell usage is slower, of course ;-) Nevertheless, I'm a little bit curious whether someone else sees _ANY_ reason to keep those sub-shell constructs? If nobody has any objections I would just cleanup these two scripts by removing the sub-shell constructs... Index: tmp =================================================================== RCS file: /v/freebsd/cvs/src/etc/rc.d/tmp,v retrieving revision 1.37 diff -u -d -r1.37 tmp --- tmp 2 Dec 2005 20:35:23 -0000 1.37 +++ tmp 22 May 2007 14:18:48 -0000 @@ -48,7 +48,7 @@ [Nn][Oo]) ;; *) - if (/bin/mkdir -p /tmp/.diskless 2> /dev/null); then + if /bin/mkdir -p /tmp/.diskless 2> /dev/null; then rmdir /tmp/.diskless else if [ -h /tmp ]; then Index: var =================================================================== RCS file: /v/freebsd/cvs/src/etc/rc.d/var,v retrieving revision 1.42 diff -u -d -r1.42 var --- var 2 Apr 2007 22:53:07 -0000 1.42 +++ var 22 May 2007 14:18:09 -0000 @@ -60,7 +60,7 @@ [Nn][Oo]) ;; *) - if (/bin/mkdir -p /var/.diskless 2> /dev/null); then + if /bin/mkdir -p /var/.diskless 2> /dev/null; then rmdir /var/.diskless else mount_md ${varsize} /var "${varmfs_flags}" -- rse@FreeBSD.org Ralf S. Engelschall FreeBSD.org/~rse rse@engelschall.com FreeBSD committer www.engelschall.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070523081749.GA18197>