Hi,

I have a situation where I want to create with a script a directory path based on input. The mkdir -p allows this nicely. However since I want to enforce certain permissions on it I thought that I can use mkdir -pm<mode> to create this. However it seems that when using both options, the parent directories created won't get the --mode given, but instead use the default mask. Is this intentional as I would think it as bug?

$ mkdir -pm0700 baz/bar
$ ls -lhd baz/ baz/bar
drwxrwxr-x 3 [user] [group] 4.0K 2012-04-27 14:47 baz/
drwx------ 2 [user] [group] 4.0K 2012-04-27 14:47 baz/bar
$ mkdir --version
mkdir (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.

Regards,
--
Henrikki Almusa

Reply via email to