Skip to main content

Inheriting rights

More
18 years 10 months ago #13282 by IIL
Inheriting rights was created by IIL
Can someone give me a tip how to make a new directory inherit rights from its parent directory?
More
18 years 10 months ago #13286 by nske
Replied by nske on topic Re: Inheriting rights
I don't know what kind of implementation for this you need, however here's a three-line bash script that would do just that (at least in gnu-linux).
[code:1]#!/bin/bash
MOTHERDIR=`dirname $1`
MOTHERPERM=`stat -c %a $MOTHERDIR`
mkdir -m $MOTHERPERM $1
[/code:1]

So i.e. you could put this in a file called /usr/bin/mkdir2, chmod +x /usr/bin/mkdir2; and then create your directories using 'mkdir2 /absolute/path/of/new/directory'
More
18 years 9 months ago #13327 by IIL
Replied by IIL on topic Re: Inheriting rights
Yes, this is what I mean. However, what if I want to do the same in gnome?
Time to create page: 0.115 seconds