blob: ceaf70ed1dba4c9412b7149d83b6e887a817da1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
.\"
.\" Copyright (c) 2025 Rick Macklem
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.Dd April 15, 2025
.Dt RUNAT 1
.Os
.Sh NAME
.Nm runat
.Nd run a shell command on a named attribute directory
.Sh SYNOPSIS
.Nm
.Op Ar file
.Op Ar shell command
.Sh DESCRIPTION
The
.Nm
utility runs the shell command on the named attribute directory for the
.Ar file
argument.
It does a
.Xr fchdir 2
system call to change the current working directory into the
named attribute directory for the
.Ar file
argument and then performs the shell command via
.Xr sh 1 .
.Pp
If a named attribute directory does not exist for
.Ar file ,
an empty one will be created.
If an application needs to determine if a named attribute
exists for the
.Ar file ,
.Xr pathconf 2
with the name
.Fa _PC_HAS_NAMEDATTR
may be used.
This will not create an empty named attribute directory
if one does not exist for
.Ar file .
.Sh EXAMPLES
For a
.Ar file
called
.Dq myfile :
.Bd -literal
$ runat myfile ls -l # lists the attributes for myfile
$ runat myfile cp /etc/hosts attrhosts # creates attrhosts
$ runat myfile cat attrhosts # displays contents of attrhosts
.Ed
.Sh SEE ALSO
.Xr sh 1 ,
.Xr fchdir 2 ,
.Xr pathconf 2 ,
.Xr open 2 ,
.Xr named_attribute 7
.Sh HISTORY
The
.Nm
utility first appeared in
.Fx 15.0 .
|