bug-bash
[Top][All Lists]
Advanced

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

Re: Creating directories with sticky bit set


From: Greg Wooledge
Subject: Re: Creating directories with sticky bit set
Date: Thu, 12 Mar 2009 08:09:01 -0400
User-agent: Mutt/1.4.2.2i

On Thu, Mar 12, 2009 at 09:50:49AM +0200, Angel Tsankov wrote:
> What can I do so that every directory I create has the sticky bit set?

If you only ever create directories from interactive shells with
the "mkdir" command, you could override it with a function:

mkdir() {
  command mkdir "$@" &&
  chmod +t "$@"
}

(In reality you'd want to process function arguments, and remove for
example a "-p" option before passing them along to chmod.  I'll leave
that part as an exercise.)

If you ever create directories through applications, though, this
approach will not help you.  In the latter case, there is no answer
except modifying your operating system.




reply via email to

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