aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info/exec-as.texinfo
blob: e9186502347b844c94dee149535bfa55c7a01cc8 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
\input texinfo   @c -*-texinfo-*-

@c %**start of header
@setfilename exec-as.info
@settitle exec-as
@afourpaper
@documentencoding UTF-8
@documentlanguage en
@finalout
@c %**end of header


@dircategory Miscellaneous
@direntry
* exec-as: (exec-as).               exec with explicit argv[0]
@end direntry


@copying
Copyright @copyright{} 2015 Mattias Andrée

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
``GNU Free Documentation License''.
@end quotation
@end copying

@ifnottex
@node Top
@top exec-as -- exec with explicit argv[0]
@insertcopying
@end ifnottex

@titlepage
@title exec-as
@subtitle exec with explicit @code{argv[0]}
@author by Mattias Andrée (maandree)

@page
@vskip 0pt plus 1filll
@insertcopying
@page
@end titlepage

@contents



@menu
* Overview::                        Brief overview of @command{exec-as}.
* Invoking::                        Executing @command{exec-as}.
* GNU Free Documentation License::  Copying and sharing this manual.
@end menu



@node Overview
@chapter Overview
@command{exec-as} shall spawn a program and
lets the user specify a value for @code{argv[0]}
explicitly.

@command{exec-as} is intended as a shell
command. It makes no since to use it from most
programming languages.

Since this is not a builtin function, it cannot
be used as @command{exec} without arguments to
set file descriptors.

Because this is not a builtin function, running
@command{exec-as} would normally do an fork–exec
rather than just an exec. To just perform an
exec, you need to use @command{exec} too:
@code{exec exec-as}



@node Invoking
@chapter Invoking

At least two arguments are required. The first
argument is the file to run. This can either
be an absolute path, an explicitly relative path,
or a file in @env{$PATH}. The second argument
is the name of the process, @code{argv[0]}.
The following arguments are the rest in of the
values in @code{argv}, often called the
command line arguments.

@command{'exec-as bash -bash'} will run the first
program in @env{$PATH} named @command{bash}, and
set @code{argv[0]} to @code{-bash} (making it a
login shell.) You can add addition argument as
needed.



@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include fdl.texinfo

@bye