aboutsummaryrefslogtreecommitdiffstats
path: root/exec-as.1
blob: cf5c14f8e3445f65f45871d7a3f51959a6bc1da9 (plain) (blame)
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
.TH EXEC-AS 1 EXEC-AS
.SH NAME
exec-as - exec(1) with explicit argv[0]
.SH SYNOPSIS
.B exec-as
.I command
.RI [ argv0
.RI [ arg \ ...]]
.SH DESCRIPTION
.B exec-as
runs the program
.IR command ,
using
.BR execvp (3),
using
.I argv0
as the value for
.BR argv[0] ,
and the following arguments for the following values in
.BR argv .
.SH NOTES
At least one argument is required. Since this is not
a builtin function, it cannot be used as
.BR exec (1)
without arguments to set file descriptors.
.PP
Because this is not a builtin function, running this
program would normally do an fork–exec rather than
just an exec. To just perform an exec, you need to
use
.BR exec (1)
too:
.B exec exec-as
.SH EXAMPLES
.B exec-as bash -bash
will run the first program in
.B $PATH
named
.BR bash ,
and set
.B argv[0]
to
.B \-bash
(making it a login shell.) You can add addition argument as needed.
.SH "SEE ALSO"
.BR exec (1),
.BR exec (3)
.SH AUTHORS
Mattias Andrée
.RI < maandree@kth.se >