]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | .TH NASH 8 "Sat Mar 27 1999" |
2 | .UC 4 | |
3 | .SH NAME | |
4 | nash \- script interpretor to interpret linuxrc images | |
5 | .SH SYNOPSIS | |
6 | \fBnash\fR [--quiet] [--force] \fIscript\fR | |
7 | ||
8 | .SH DESCRIPTION | |
9 | \fBnash\fR is a very simple script interpretor designed to be as small as | |
10 | possible. It is primarily designed to run simple linuxrc scripts on an initrd | |
11 | image. Arguments to commands may be enclosed in either single or double | |
12 | quotes to allow spaces to be included in the arguments. Spaces outside of | |
13 | quotations always delineate arguments, and so backslash escaping is supported. | |
14 | ||
15 | Additionally, if nash is invoked as \fBmodprobe\fR, it will immediately | |
16 | exit with a return code of zero. This is to allow initrd's to prevent some | |
17 | extraneous kernel error messages during startup. | |
18 | ||
19 | There are two types of commands, built in and external. External commands | |
20 | are run from the filesystem via execve(). If commands names are given without | |
21 | a path, nash will search it's builtin PATH, which is /usr/bin, /bin, | |
22 | /sbin, /usr/sbin. | |
23 | ||
24 | Currently, \fBnash\fR supports the following built in commands. | |
25 | ||
26 | .TP | |
27 | \fBaccess -[r][w][x][f] \fIpath\fR | |
28 | Tells whether the current user has sufficient permissions to read, write, or | |
29 | execture \fIpath\fR, or if the file exists (see \fBaccess(2)\fR for more | |
30 | information). | |
31 | ||
32 | .TP | |
33 | \fBecho [item]* [> \fIfilename\fR]\fR | |
34 | Echos the text strings given to a file, with a space in between each | |
35 | item. The output may be optionally redirected to a file. | |
36 | ||
37 | \fBexec\fR \fI<command>\fR | |
38 | The command given is execed, overlaying the nash process. | |
39 | ||
40 | .TP | |
41 | \fBfind \fIdir\fR -name \fIname\fR | |
42 | Display the path to files named \fIname\fR in or below directory \fIdir\FR. | |
43 | This is a \fBvery\fR limited implementation of find(1). | |
44 | ||
45 | .TP | |
46 | \fBfindlodev\fR | |
47 | Prints the full path to the first unused loopback block device on the | |
48 | system. If none is available, no output is displayed. | |
49 | ||
50 | .TP | |
51 | \fBlosetup \fI/dev/loopdev\fR \fIfile\fR | |
52 | Binds \fIfile\fR to the loopback device \fI/dev/loopdev\fR. See | |
53 | \fBlosetup(8)\fR for information on loopback devices. | |
54 | ||
55 | .TP | |
56 | \fBmkdevices\fR \fIpath\fR | |
57 | Creates device files for all of the block devices listed in | |
58 | \fB/proc/partitions\fR in the directory specfied by \fIpath\fR. | |
59 | ||
60 | .TP | |
61 | \fBmkdir\fR \fI[-p]\fR \fIpath\fR | |
62 | Creates the directory \fIpath\fR. If \fI-p\fR is specified, this command | |
63 | will not complain if the directory exists. Note this is a subset of the | |
64 | standard \fBmkdir\fR \fI-p\fR behavior. | |
65 | ||
66 | .TP | |
67 | \fBmknod\fR \fIpath\fR \fI[c|b]\fR \fImajor\fR \fIminor\fR | |
68 | Creates a device inode for \fIpath\fR. This is identical to \fBmkdev\fR(1) | |
69 | which the exceptions that it will not create named pipes and if the directories | |
70 | in \fIpath\fR do not exist they will be automatically created. | |
71 | ||
72 | .TP | |
73 | \fBmkrootdev \fIpath\fR | |
74 | Makes \fIpath\fR a block inode for the device which should be mounted | |
75 | as root. To determine this device nash uses | |
76 | the device suggested by the root= kernel command line argument (if | |
77 | root=LABEL is used devices are probed to find one with that label). If | |
78 | no root= argument is available, /proc/sys/kernel/real-root-dev provides | |
79 | the device number. | |
80 | ||
81 | .TP | |
82 | \fBmount \fI[--ro]\fR -o \fIopts\fR -t \fItype\fR \fIdevice\fR \fImntpoint\fR | |
83 | Mounts a filesystem. It does not support NFS, and it must be used in | |
84 | the form given above (arguments must go first). If \fIdevice\fR is of the form | |
85 | \fBLABEL=\fIfoo\fR the devices listed in /fB/proc/partitions\fR will | |
86 | be searched, and the first device with a volume label of \fIfoo\fR will | |
87 | be mounted. Normal \fBmount\fR(2) options are supported, and \fB--ro\fR will | |
88 | mount the filesystem read only for compatibility with older versions of nash. | |
89 | The \fBdefaults\fR mount option is silently ignored. | |
90 | ||
91 | .TP | |
92 | \fBpivot_root \fInewrootpath\fR \fIoldrootpath\fR | |
93 | Makes the filesystem mounted at \fInewrootpath\fR the new root filesystem, | |
94 | and mounts the current root filesystem as \fIoldrootpath\fR. | |
95 | ||
96 | .TP | |
97 | \fBraidautorun \fImddevice\fR | |
98 | Runs raid autodetection on all raid-typed partitions. \fImddevice\fR must | |
99 | be a raid device (any will do). | |
100 | ||
101 | .TP | |
102 | \fBshowlabels\fR | |
103 | Display a table of devices, their filesystem labels, and their uuids. | |
104 | ||
105 | .TP | |
106 | \fBumount \fIpath\fR | |
107 | Unmounts the filesystem mounted at \fIpath\fR. | |
108 | ||
109 | .SH RETURN VALUE | |
110 | Returns 0 is the last command succeeded or 1 if it failed. | |
111 | ||
112 | .SH OPTIONS | |
113 | .TP | |
114 | \fB-\-force\fR | |
115 | Allows \fBforce\fR really execute the script, even though \fBnash\fR doesn't | |
116 | appear to be running from an initrd image. | |
117 | ||
118 | .SH BUGS | |
119 | Probably many. \fBnash\fR is \fbnot a shell\fR, and it shouldn't be thought of | |
120 | as one. It isn't entirely different from a shell, but that's mostly by | |
121 | accident. | |
122 | ||
123 | .SH AUTHOR | |
124 | .nf | |
125 | Erik Troan <ewt@redhat.com> | |
126 | .fi |