bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir owner:group option


From: Jim Meyering
Subject: Re: mkdir owner:group option
Date: Tue, 10 Mar 2009 10:54:49 +0100

Pádraig Brady wrote:
> Caleb Cushing wrote:
>> be awesome if mkdir had a way to specify the user:group ownership
>> being made. given this would be limited by perms. but as root it could
>> be good.
>>
>> just throwing it out there.
>
> Perhaps a simple wrapper around install would be better?
>
> mkudir() { u="$1"; g="$2"; shift 2; install -d -o$u -g$g "$@"; }

For the record, you can (and IMHO should; less syntax is better) avoid
quoting a simple $var on the RHS, and you must double-quote _uses_ of
variables like $u and $g that may potentially contain meta-characters:

mkudir() { u=$1; g=$2; shift 2; install -d -o"$u" -g"$g" "$@"; }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]