Power profile script

Dan Nelson dnelson at allantgroup.com
Mon Dec 15 15:16:51 PST 2003


In the last episode (Dec 15), Bruce M Simpson said:
> On Sat, Dec 13, 2003 at 01:12:03PM -0800, Nate Lawson wrote:
> > I'm mostly looking for style input on the /etc/power_profile script since
> > I'm not familiar with our scripting guidelines.  Note that it's called
> > from devd (or manually by the user) and is not an rc.d boot-time thing.
> 
> One of the things green suggested to me when I was airing out the new
> trafd.sh rcNG script was the use of $(...) instead of the backtick
> operator -- apparently this has slightly different semantics but it
> does save on forking overhead.

It shouldn't have any difference wrt overhead; `` and $() end up doing
just about the same thing in src/bin/sh/parser.c; see the code starting
at parsebackq.  oldstyle is 1 when processing the `` style.  They both
fork under the same conditions.  I use the $() syntax mainly because
it's easier to nest.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-arch mailing list