Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: umask for process substitution



On Feb 20,  2:41pm, Paul Lew wrote:
}
} Is there a way to set umask for temporary file created with =(cmd)?

No, there isn't.

However, because of the order in which zsh creates/removes those temp
files, you can do something like this:

    { f==(cmd); chmod a+r $f; suidprog $f }

That is, the file will persist until the end of the braces (and maybe
longer, depending on the structure of the command).

If your operating system supports /dev/fd/, you might be able to do this:

    suidprog =(chmod a+r /dev/fd/1; cmd)

It depends on the implementation of /dev/fd ... it works on Linux, but I
doubt it works on Solaris.



Messages sorted by: Reverse Date, Date, Thread, Author