LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What does the - before the filename mean in setfacl --set-file ? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-the-before-the-filename-mean-in-setfacl-set-file-4175472614/)

Grtyop 08-08-2013 05:53 AM

What does the - before the filename mean in setfacl --set-file ?
 
For example, to copy the ACL from one file to another, the command is getfacl notes | setfacl --set-file=- notes2.

Why is there a need for the - after the = sign ?

I tried it without the -, and I got "No such file or directory" ..

Additionally, I googled and there seems to be a -f option for setfacl, but the man page doesn't state it. Anybody can shed light on this well ? Thanks alot :)

druuna 08-08-2013 06:00 AM

The dash tells setfacl to read from standard input, which is needed due to the pipe used.

From the setfacl man page:
Quote:

- If the file name parameter is a single dash, setfacl reads a list of files from standard input.
Quote:

Originally Posted by Grtyop
Additionally, I googled and there seems to be a -f option for setfacl, but the man page doesn't state it. Anybody can shed light on this well ?

Maybe that option is only available in new(er) versions of setfacl. It isn't present in mine either (Debian Squeeze):
Code:

$ setfacl -v
setfacl 2.2.49


Grtyop 08-08-2013 06:05 AM

Holy, I totally missed that line in the man page.. My bad. Kudos.

Oh I see, thanks alot. In any case, I spotted the -f option here.


All times are GMT -5. The time now is 04:07 AM.