From f12f2c382803938fcfdd72e6e50cb03d8028d676 Mon Sep 17 00:00:00 2001
From: Gregory Nutt
Overview.
The NuttShell (NSH) is a simple shell application that may be used with NuttX.
- It supports a variety of commands and is (very) loosely based on the bash shell and the common utilities used in Unix shell programming.
+ It supports a variety of commands and is (very) loosely based on the Bash shell and the common utilities used with Bash shell programming.
The paragraphs in this appendix will focus on customizing NSH: Adding new commands, changing the initialization sequence, etc.
/bin.
Using binfs, you can see the available builtin applications by listing the contents of /bin directory.
- This gives some superficial Unix compatibility, but does not really add any new functionality.
+ This gives some superficial Unix-like compatibility, but does not really add any new functionality.
Line Endings.
- Files should be formatted with \n as the line ending (Unix line endings), not \r\n (Windows line endings).
+ Files should be formatted with \n as the line ending (Unix-style line endings), not \r\n (Windows line endings).
There should be no extra whitespace at the end of the line.
In addition, all text files should end in a single newline (\n). This avoids the "No newline at end of file" warning generated by certain tools.
POSIX Compatibility: - Compatible with the Unix interface of the same name. + Compatible with the BSD/Linux interface of the same name. POSIX marks this interface as Obsolete.
Note the inefficiency when execv() or execl() is called in the normal, two-step process:
(1) first call vfork() to create a new thread, then (2) call execv() or execl() to replace the new thread with a program from the file system.
- Since the new thread will be terminated by the execv() or execl() call, it really served no purpose other than to support Unix compatibility.
+ Since the new thread will be terminated by the execv() or execl() call, it really served no purpose other than to support POSIX compatibility.
The non-standard binfmt function exec() needs to have (1) a symbol table that provides the list of symbols exported by the base code, and (2) the number of symbols in that table.
@@ -991,7 +991,7 @@ int execv(FAR const char *path, FAR char *const argv[]);
POSIX Compatibility: - Similar with the Unix interface of the same name. + Similar with the POSIX interface of the same name. There are, however, several compatibility issues as detailed in the description above.
@@ -1035,7 +1035,7 @@ int execl(FAR const char *path, ...);POSIX Compatibility: - Similar with the Unix interface of the same name. + Similar with the POSIX interface of the same name. There are, however, several compatibility issues as detailed in the description of execv().