fs/procfs/fs_procfsproc.c: Change output of the env file so that it looks more like output from the 'env' command. Documentation/NuttShell.html: Document the new NSH 'env' command.
This commit is contained in:
parent
a037aeec5d
commit
4391b51cd3
@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
|
||||
<p>Last Updated: August 28, 2018</p>
|
||||
<p>Last Updated: September 30, 2018</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -191,325 +191,331 @@
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdexec">2.18 Execute User Code (exec)</a>
|
||||
<a href="#cmdenv">2.18 Show Environment Variables (env)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdexit">2.19 Exit NSH (exit)</a>
|
||||
<a href="#cmdexec">2.19 Execute User Code (exec)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdfree">2.20 Show Memory Manager Status (free)</a>
|
||||
<a href="#cmdexit">2.20 Exit NSH (exit)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdget">2.21 Get File Via TFTP (get)</a>
|
||||
<a href="#cmdfree">2.21 Show Memory Manager Status (free)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdhelp">2.22 Show Usage Command Usage (help)</a>
|
||||
<a href="#cmdget">2.22 Get File Via TFTP (get)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdhexdump">2.23 Hexadecimal Dump of File or Device (hexdump)</a>
|
||||
<a href="#cmdhelp">2.23 Show Usage Command Usage (help)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdifconfig">2.24 Manage Network Configuration (ifconfig)</a>
|
||||
<a href="#cmdhexdump">2.24 Hexadecimal Dump of File or Device (hexdump)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdifdown">2.25 Take a network down (ifdown)</a>
|
||||
<a href="#cmdifconfig">2.25 Manage Network Configuration (ifconfig)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdifup">2.26 Bring a network up (ifup)</a>
|
||||
<a href="#cmdifdown">2.26 Take a network down (ifdown)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdinsmod">2.27 Install an OS module (insmod)</a>
|
||||
<a href="#cmdifup">2.27 Bring a network up (ifup)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdirqinfo">2.28 Show Interrupt Status (irqinfo)</a>
|
||||
<a href="#cmdinsmod">2.28 Install an OS module (insmod)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdkill">2.29 Send a signal to a task (kill)</a>
|
||||
<a href="#cmdirqinfo">2.29 Show Interrupt Status (irqinfo)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdlosetup">2.30 Setup/teardown the Loop Device (losetup)</a>
|
||||
<a href="#cmdkill">2.30 Send a signal to a task (kill)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdln">2.31 List to a File or Directory (ln)</a>
|
||||
<a href="#cmdlosetup">2.31 Setup/teardown the Loop Device (losetup)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdls">2.32 List Directory Contents (ls)</a>
|
||||
<a href="#cmdln">2.32 List to a File or Directory (ln)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdlsmod">2.33 Show information about installed OS modules (lsmod)</a>
|
||||
<a href="#cmdls">2.33 List Directory Contents (ls)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmd5">2.34 Calculate MD5 (md5)</a>
|
||||
<a href="#cmdlsmod">2.34 Show information about installed OS modules (lsmod)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmbhw">2.35 Access Memory (mb, mh, and mw)</a>
|
||||
<a href="#cmdmd5">2.35 Calculate MD5 (md5)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdps">2.36 Show Current Tasks and Threads (ps)</a>
|
||||
<a href="#cmdmbhw">2.36 Access Memory (mb, mh, and mw)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmkdir">2.37 Create a Directory (mkdir)</a>
|
||||
<a href="#cmdps">2.37 Show Current Tasks and Threads (ps)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmkfatfs">2.38 Create a FAT File System (mkfatfs)</a>
|
||||
<a href="#cmdmkdir">2.38 Create a Directory (mkdir)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmkfifo">2.39 Create a FIFO (mkfifo)</a>
|
||||
<a href="#cmdmkfatfs">2.39 Create a FAT File System (mkfatfs)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmkrd">2.40 Create a RAMDISK (mkrd)</a>
|
||||
<a href="#cmdmkfifo">2.40 Create a FIFO (mkfifo)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmount">2.41 Mount a File System (mount)</a>
|
||||
<a href="#cmdmkrd">2.41 Create a RAMDISK (mkrd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmv">2.42 Rename a File (mv)</a>
|
||||
<a href="#cmdmount">2.42 Mount a File System (mount)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdnfsmount">2.43 Mount an NFS File System (nfsmount)</a>
|
||||
<a href="#cmdmv">2.43 Rename a File (mv)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdnslookup">2.44 Lookup a network address (nslookup)</a>
|
||||
<a href="#cmdnfsmount">2.44 Mount an NFS File System (nfsmount)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdpasswd">2.45 Change a User's Password (passwd)</a>
|
||||
<a href="#cmdnslookup">2.45 Lookup a network address (nslookup)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdpoweroff">2.46 Shut the system down (poweroff)</a>
|
||||
<a href="#cmdpasswd">2.46 Change a User's Password (passwd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdput">2.47 Send File Via TFTP (put)</a>
|
||||
<a href="#cmdpoweroff">2.47 Shut the system down (poweroff)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdpwd">2.48 Show Current Working Directory (pwd)</a>
|
||||
<a href="#cmdput">2.48 Send File Via TFTP (put)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdreadlink">2.49 Show target of a link (readlink)</a>
|
||||
<a href="#cmdpwd">2.49 Show Current Working Directory (pwd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdreboot">2.50 Reset and reboot the system (reboot)</a>
|
||||
<a href="#cmdreadlink">2.50 Show target of a link (readlink)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdrm">2.51 Remove a File (rm)</a>
|
||||
<a href="#cmdreboot">2.51 Reset and reboot the system (reboot)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdrmdir">2.52 Remove a Directory (rmdir)</a>
|
||||
<a href="#cmdrm">2.52 Remove a File (rm)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdrmmod">2.53 Remove on OS Module (rmmod)</a>
|
||||
<a href="#cmdrmdir">2.53 Remove a Directory (rmdir)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdroute">2.54 Show routing table (route)</a>
|
||||
<a href="#cmdrmmod">2.54 Remove on OS Module (rmmod)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdset">2.55 Set an Environment Variable (set)</a>
|
||||
<a href="#cmdroute">2.55 Show routing table (route)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdsh">2.56 Execute an NSH Script (sh)</a>
|
||||
<a href="#cmdset">2.56 Set an Environment Variable (set)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdshutdown">2.57 Shut the system down (shutdown)</a>
|
||||
<a href="#cmdsh">2.57 Execute an NSH Script (sh)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdsleep">2.58 Wait for Seconds (sleep)</a>
|
||||
<a href="#cmdshutdown">2.58 Shut the system down (shutdown)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdtelnetd">2.59 Start the Telnet Daemon (telnetd)</a>
|
||||
<a href="#cmdsleep">2.59 Wait for Seconds (sleep)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdtime">2.60 Time execution of another command (time)</a>
|
||||
<a href="#cmdtelnetd">2.60 Start the Telnet Daemon (telnetd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdtruncate">2.61 Set the Size of a File (truncate)</a>
|
||||
<a href="#cmdtime">2.61 Time execution of another command (time)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdunmount">2.62 Unmount a File System (umount)</a>
|
||||
<a href="#cmdtruncate">2.62 Set the Size of a File (truncate)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmduname">2.63 Print system information (uname)</a>
|
||||
<a href="#cmdunmount">2.63 Unmount a File System (umount)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdunset">2.64 Unset an Environment Variable (unset)</a>
|
||||
<a href="#cmduname">2.64 Print system information (uname)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdurldec">2.65 URL Decode (urldecode)</a>
|
||||
<a href="#cmdunset">2.65 Unset an Environment Variable (unset)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdurlencode">2.66 URL Encode (urlencode)</a>
|
||||
<a href="#cmdurldec">2.66 URL Decode (urldecode)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmduseradd">2.67 Add a New User (useradd)</a>
|
||||
<a href="#cmdurlencode">2.67 URL Encode (urlencode)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmduserdel">2.68 Delete a user (userdel)</a>
|
||||
<a href="#cmduseradd">2.68 Add a New User (useradd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdusleep">2.69 Wait for Microseconds (usleep)</a>
|
||||
<a href="#cmduserdel">2.69 Delete a user (userdel)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdwget">2.70 Get File Via HTTP (wget)</a>
|
||||
<a href="#cmdusleep">2.70 Wait for Microseconds (usleep)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdxd">2.71 Hexadecimal Dump of Memory (xd)</a>
|
||||
<a href="#cmdwget">2.71 Get File Via HTTP (wget)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdxd">2.72 Hexadecimal Dump of Memory (xd)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1647,7 +1653,39 @@ echo [-n] [<string|$name> [<string|$name>...]]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdexec"><h2>2.18 Execute User Code (exec)</h2></a>
|
||||
<a name="cmdenv"><h2>2.18 Show Environment Variables (env)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Command Syntax:</b></p>
|
||||
<ul><pre>
|
||||
env
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>.
|
||||
Show the current address environment. Example:.
|
||||
</p>
|
||||
<ul><pre>
|
||||
nsh> env
|
||||
PATH=/bin
|
||||
|
||||
nsh> set foo bar
|
||||
nsh> env
|
||||
PATH=/bin
|
||||
foo=bar
|
||||
|
||||
nsh> unset PATH
|
||||
nsh> env
|
||||
foo=bar
|
||||
|
||||
nsh>
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdexec"><h2>2.19 Execute User Code (exec)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1666,7 +1704,7 @@ exec <hex-address>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdexit"><h2>2.19 Exit NSH (exit)</h2></a>
|
||||
<a name="cmdexit"><h2>2.20 Exit NSH (exit)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1685,7 +1723,7 @@ exit
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdfree"><h2>2.20 Show Memory Manager Status (free)</h2></a>
|
||||
<a name="cmdfree"><h2>2.21 Show Memory Manager Status (free)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1727,7 +1765,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdget"><h2>2.21 Get File Via TFTP (get)</h2></a>
|
||||
<a name="cmdget"><h2>2.22 Get File Via TFTP (get)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1762,7 +1800,7 @@ get [-b|-n] [-f <local-path>] -h <ip-address> <remote-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdhelp"><h2>2.22 Show Usage Command Usage (help)</h2></a>
|
||||
<a name="cmdhelp"><h2>2.23 Show Usage Command Usage (help)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1794,7 +1832,7 @@ help [-v] [<cmd>]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdhexdump"><h2>2.23 Hexadecimal Dump of File or Device (hexdump)</h2></a>
|
||||
<a name="cmdhexdump"><h2>2.24 Hexadecimal Dump of File or Device (hexdump)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1824,7 +1862,7 @@ The <code>skip</code> and <code>count</code> options are only available if <code
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdifconfig"><h2>2.24 Manage Network Configuration (ifconfig)</h2></a>
|
||||
<a name="cmdifconfig"><h2>2.25 Manage Network Configuration (ifconfig)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1886,7 +1924,7 @@ nsh> mount -t procfs /proc
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdifdown"><h2>2.25 Take a network down (ifdown)</h2></a>
|
||||
<a name="cmdifdown"><h2>2.26 Take a network down (ifdown)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1909,7 +1947,7 @@ ifdown eth0
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdifup"><h2>2.26 Bring a network up (ifup)</h2></a>
|
||||
<a name="cmdifup"><h2>2.27 Bring a network up (ifup)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1932,7 +1970,7 @@ ifup eth0
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdinsmod"><h2>2.27 Install an OS module (insmod)</h2></a>
|
||||
<a name="cmdinsmod"><h2>2.28 Install an OS module (insmod)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2002,7 +2040,7 @@ IRQ HANDLER ARGUMENT COUNT RATE
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdkill"><h2>2.29 Send a signal to a task (kill)</h2></a>
|
||||
<a name="cmdkill"><h2>2.30 Send a signal to a task (kill)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2049,7 +2087,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdlosetup"><h2>2.30 Setup/teardown the Loop Device (losetup)</h2></a>
|
||||
<a name="cmdlosetup"><h2>2.31 Setup/teardown the Loop Device (losetup)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2102,7 +2140,7 @@ losetup d <dev-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdln"><h2>2.31 Link to a File or Directory (ln)</h2></a>
|
||||
<a name="cmdln"><h2>2.32 Link to a File or Directory (ln)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2127,7 +2165,7 @@ ln [-s] <target> <link>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdls"><h2>2.32 List Directory Contents (ls)</h2></a>
|
||||
<a name="cmdls"><h2>2.33 List Directory Contents (ls)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2165,7 +2203,7 @@ ls [-lRs] <dir-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdlsmod"><h2>2.33 Show information about installed OS modules (lsmod)</h2></a>
|
||||
<a name="cmdlsmod"><h2>2.34 Show information about installed OS modules (lsmod)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2198,7 +2236,7 @@ mydriver 20404659 20404625 0 20404580 552 204047a8 0
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmd5"><h2>2.34 Calculate MD5 (md5)</h2></a>
|
||||
<a name="cmdmd5"><h2>2.35 Calculate MD5 (md5)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2215,7 +2253,7 @@ md5 [-f] <string or filepath>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmbhw"><h2>2.35 Access Memory (mb, mh, and mw)</h2></a>
|
||||
<a name="cmdmbhw"><h2>2.36 Access Memory (mb, mh, and mw)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2268,7 +2306,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdps"><h2>2.36 Show Current Tasks and Threads (ps)</h2></a>
|
||||
<a name="cmdps"><h2>2.37 Show Current Tasks and Threads (ps)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2302,7 +2340,7 @@ nsh> mount -t procfs /proc
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmkdir"><h2>2.37 Create a Directory (mkdir)</h2></a>
|
||||
<a name="cmdmkdir"><h2>2.38 Create a Directory (mkdir)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2337,7 +2375,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmkfatfs"><h2>2.38 Create a FAT File System (mkfatfs)</h2></a>
|
||||
<a name="cmdmkfatfs"><h2>2.39 Create a FAT File System (mkfatfs)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2369,7 +2407,7 @@ mkfatfs [-F <fatsize>] [-r <rootdirentries>] <block-driver>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmkfifo"><h2>2.39 Create a FIFO (mkfifo)</h2></a>
|
||||
<a name="cmdmkfifo"><h2>2.40 Create a FIFO (mkfifo)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2407,7 +2445,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmkrd"><h2>2.40 Create a RAMDISK (mkrd)</h2></a>
|
||||
<a name="cmdmkrd"><h2>2.41 Create a RAMDISK (mkrd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2458,7 +2496,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmount"><h2>2.41 Mount a File System (mount)</h2></a>
|
||||
<a name="cmdmount"><h2>2.42 Mount a File System (mount)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2537,7 +2575,7 @@ nsh> mount
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmv"><h2>2.42 Rename a File (mv)</h2></a>
|
||||
<a name="cmdmv"><h2>2.43 Rename a File (mv)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2555,7 +2593,7 @@ mv <old-path> <new-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdnfsmount"><h2>2.43 Mount an NFS file system (nfsmount)</h2></a>
|
||||
<a name="cmdnfsmount"><h2>2.44 Mount an NFS file system (nfsmount)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2574,7 +2612,7 @@ nfsmount <server-address> <mount-point> <remote-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdnslookup"><h2>2.44 Lookup a network address (nslookup)</h2></a>
|
||||
<a name="cmdnslookup"><h2>2.45 Lookup a network address (nslookup)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2591,7 +2629,7 @@ nslookup <host-name>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdpasswd"><h2>2.45 Change a User's Password (passwd)</h2></a>
|
||||
<a name="cmdpasswd"><h2>2.46 Change a User's Password (passwd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2608,7 +2646,7 @@ passwd <username> <password>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdpoweroff"><h2>2.46 Shut the system down (poweroff)</h2></a>
|
||||
<a name="cmdpoweroff"><h2>2.47 Shut the system down (poweroff)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2632,7 +2670,7 @@ poweroff [<n>]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdput"><h2>2.47 Send File Via TFTP (put)</h2></a>
|
||||
<a name="cmdput"><h2>2.48 Send File Via TFTP (put)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2667,7 +2705,7 @@ put [-b|-n] [-f <remote-path>] -h <ip-address> <local-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdpwd"><h2>2.48 Show Current Working Directory (pwd)</h2></a>
|
||||
<a name="cmdpwd"><h2>2.49 Show Current Working Directory (pwd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2697,7 +2735,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdreadlink"><h2>2.49 Show target of a link (readlink)</h2></a>
|
||||
<a name="cmdreadlink"><h2>2.50 Show target of a link (readlink)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2714,7 +2752,7 @@ readlink <link>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdreboot"><h2>2.50 Reboot the system (reboot)</h2></a>
|
||||
<a name="cmdreboot"><h2>2.51 Reboot the system (reboot)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2736,7 +2774,7 @@ reboot [<n>]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdrm"><h2>2.51 Remove a File (rm)</h2></a>
|
||||
<a name="cmdrm"><h2>2.52 Remove a File (rm)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2770,7 +2808,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdrmdir"><h2>2.52 Remove a Directory (rmdir)</h2></a>
|
||||
<a name="cmdrmdir"><h2>2.53 Remove a Directory (rmdir)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2805,7 +2843,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdrmmod"><h2>2.53 Remove on OS Module (rmmod)</h2></a>
|
||||
<a name="cmdrmmod"><h2>2.54 Remove on OS Module (rmmod)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2833,7 +2871,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdroute"><h2>2.54 Show routing table (route)</h2></a>
|
||||
<a name="cmdroute"><h2>2.55 Show routing table (route)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2853,7 +2891,7 @@ route ipv4|ipv6
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdset"><h2>2.55 Set an Environment Variable (set)</h2></a>
|
||||
<a name="cmdset"><h2>2.56 Set an Environment Variable (set)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2922,7 +2960,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdsh"><h2>2.56 Execute an NSH Script (sh)</h2></a>
|
||||
<a name="cmdsh"><h2>2.57 Execute an NSH Script (sh)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2940,7 +2978,7 @@ sh <script-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdshutdown"><h2>2.57 Shut the system down (shutdown)</h2></a>
|
||||
<a name="cmdshutdown"><h2>2.58 Shut the system down (shutdown)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2961,7 +2999,7 @@ shutdown [--reboot]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdsleep"><h2>2.58 Wait for Seconds (sleep)</h2></a>
|
||||
<a name="cmdsleep"><h2>2.59 Wait for Seconds (sleep)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2978,7 +3016,7 @@ sleep <sec>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdtelnetd"><h2>2.59 Time Start the Telnet Daemon (telnetd)</h2></a>
|
||||
<a name="cmdtelnetd"><h2>2.60 Time Start the Telnet Daemon (telnetd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3004,7 +3042,7 @@ telnetd
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdtime"><h2>2.60 Time execution of another command (time)</h2></a>
|
||||
<a name="cmdtime"><h2>2.61 Time execution of another command (time)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3062,7 +3100,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdtruncate"><h2>2.61 Set the Size of a File (truncate)</h2></a>
|
||||
<a name="cmdtruncate"><h2>2.62 Set the Size of a File (truncate)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3090,7 +3128,7 @@ truncate -s <length> <file-path>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdunmount"><h2>2.62 Unmount a File System (umount)</h2></a>
|
||||
<a name="cmdunmount"><h2>2.63 Unmount a File System (umount)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3120,7 +3158,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmduname"><h2>2.63 Print system information (uname)</h2></a>
|
||||
<a name="cmduname"><h2>2.64 Print system information (uname)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3187,7 +3225,7 @@ uname [-a | -imnoprsv]
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdunset"><h2>2.64 Unset an Environment Variable (unset)</h2></a>
|
||||
<a name="cmdunset"><h2>2.65 Unset an Environment Variable (unset)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3213,7 +3251,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdurldec"><h2>2.65 URL Decode (urldecode)</h2></a>
|
||||
<a name="cmdurldec"><h2>2.66 URL Decode (urldecode)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3230,7 +3268,7 @@ urldecode [-f] <string or filepath>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdurlencode"><h2>2.66 URL Encode (urlencode)</h2></a>
|
||||
<a name="cmdurlencode"><h2>2.67 URL Encode (urlencode)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3247,7 +3285,7 @@ urlencode [-f] <string or filepath>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmduseradd"><h2>2.67 Add a New User (useradd)</h2></a>
|
||||
<a name="cmduseradd"><h2>2.68 Add a New User (useradd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3264,7 +3302,7 @@ useradd <username> <password>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmduserdel"><h2>2.68 Delete a user (userdel)</h2></a>
|
||||
<a name="cmduserdel"><h2>2.69 Delete a user (userdel)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3281,7 +3319,7 @@ userdel <username>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdusleep"><h2>2.69 Wait for Microseconds (usleep)</h2></a>
|
||||
<a name="cmdusleep"><h2>2.70 Wait for Microseconds (usleep)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3298,7 +3336,7 @@ usleep <usec>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdwget"><h2>2.70 Get File Via HTTP (wget)</h2></a>
|
||||
<a name="cmdwget"><h2>2.71 Get File Via HTTP (wget)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3325,7 +3363,7 @@ wget [-o <local-path>] <url>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdxd"><h2>2.71 Hexadecimal Dump of Memory (xd)</h2></a>
|
||||
<a name="cmdxd"><h2>2.72 Hexadecimal Dump of Memory (xd)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -3531,6 +3569,11 @@ nsh>
|
||||
<td><br></td>
|
||||
<td><code>CONFIG_NSH_DISABLE_ECHO</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><code>env</code></b></td>
|
||||
<td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0 && <code>CONFIG_FS_PROCFS</code> && <code>!CONFIG_DISABLE_ENVIRON</code> && <code>!CONFIG_PROCFS_EXCLUDE_ENVIRON</code>
|
||||
<td><code>CONFIG_NSH_DISABLE_ENV</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><code>exec</code></b></td>
|
||||
<td><br></td>
|
||||
@ -5599,6 +5642,7 @@ xxd -i romfs_img >nsh_romfsimg.h
|
||||
<li><a href="#looping"><code>do</code></a></li>
|
||||
<li><a href="#looping"><code>done</code></a></li>
|
||||
<li><a href="#cmdecho"><code>echo</code></a></li>
|
||||
<li><a href="#cmdenv"><code>env</code></a></li>
|
||||
<li><a href="#environvars">Environment Variables</a></li>
|
||||
<li><a href="#startupscript"><code>/etc/init.d/rcS</code></a>
|
||||
<li><a href="#cmdexec"><code>exec</code></a></li>
|
||||
|
@ -1091,7 +1091,7 @@ static int proc_groupenv_callback(FAR void *arg, FAR const char *pair)
|
||||
|
||||
/* Output the header */
|
||||
|
||||
linesize = snprintf(info->procfile->line, STATUS_LINELEN, "%-16s %s\n",
|
||||
linesize = snprintf(info->procfile->line, STATUS_LINELEN, "%s=%s\n",
|
||||
name, value);
|
||||
copysize = procfs_memcpy(info->procfile->line, linesize, info->buffer,
|
||||
info->remaining, &info->offset);
|
||||
@ -1119,8 +1119,6 @@ static ssize_t proc_groupenv(FAR struct proc_file_s *procfile,
|
||||
off_t offset)
|
||||
{
|
||||
FAR struct task_group_s *group = tcb->group;
|
||||
size_t linesize;
|
||||
size_t copysize;
|
||||
struct proc_envinfo_s info;
|
||||
|
||||
DEBUGASSERT(group != NULL);
|
||||
@ -1134,22 +1132,6 @@ static ssize_t proc_groupenv(FAR struct proc_file_s *procfile,
|
||||
info.remaining = buflen;
|
||||
info.totalsize = 0;
|
||||
|
||||
/* Output the header */
|
||||
|
||||
linesize = snprintf(info.procfile->line, STATUS_LINELEN, "\n%-16s %s\n",
|
||||
"VAR", "VALUE");
|
||||
copysize = procfs_memcpy(info.procfile->line, linesize, info.buffer,
|
||||
info.remaining, &info.offset);
|
||||
|
||||
info.totalsize += copysize;
|
||||
info.buffer += copysize;
|
||||
info.remaining -= copysize;
|
||||
|
||||
if (info.totalsize >= info.buflen)
|
||||
{
|
||||
return info.totalsize;
|
||||
}
|
||||
|
||||
/* Generate output for each environment variable */
|
||||
|
||||
(void)env_foreach(group, proc_groupenv_callback, &info);
|
||||
|
Loading…
Reference in New Issue
Block a user