On Tuesday 10 March 2009 06:11:47 Jim Meyering wrote:
> Mike Frysinger wrote:
> > mkudir() { (u=$1; g=$2; shift 2; install -d -o"$u" -g"$g" "$@"); }
>
> Good idea.
> I prefer to use "local", and thus to avoid forking a subshell.

in general, i agree.  however, some people like to omit "local" support from 
their shell (since it isnt in POSIX), or do really stupid s**t like requiring 
quoting on the RHS (dash comes to mind).

but if you're using a sane shell, then neither of these should be an issue, 
and the proposed version is good stuff:

> Also, you can drop the semicolon between the assignments:
>
> mkudir() { local u=$1 g=$2; shift 2; install -d -o"$u" -g"$g" "$@"; }
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to