summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-10-01 15:11:42 +0000
committerjoerg <joerg@FreeBSD.org>1995-10-01 15:11:42 +0000
commit31323db649288b3e4490de664d1fd0a9d27c02f0 (patch)
tree1078fd60f95fb90ce724202147f6c60b574737e2 /bin
parent2d9159367e8542f93050839390160f3457d3c955 (diff)
downloadFreeBSD-src-31323db649288b3e4490de664d1fd0a9d27c02f0.zip
FreeBSD-src-31323db649288b3e4490de664d1fd0a9d27c02f0.tar.gz
Posixize:
sh -c [-aCefinuvx] command_string [ command_name [argument ...] ] 1 4.56.3 Options -c Read commands from the command_string operand. Set the value of special parameter 0 (see 3.5.2) from the value of the command_name operand and the positional parameters ($1, $2, etc.) in sequence from the remaining argument operands. Pointed out by: Kaleb Keithly (kaleb@x.org)
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c
index 92e04ca..de6f60c 100644
--- a/bin/sh/options.c
+++ b/bin/sh/options.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: options.c,v 1.3 1995/05/30 00:07:21 rgrimes Exp $
+ * $Id: options.c,v 1.4 1995/08/06 19:35:33 joerg Exp $
*/
#ifndef lint
@@ -106,6 +106,9 @@ procargs(argc, argv)
commandname = arg0 = *argptr++;
setinputfile(commandname, 0);
}
+ if (minusc)
+ /* Posix.2: first arg after -c cmd is $0, remainder $1... */
+ arg0 = *argptr++;
shellparam.p = argptr;
/* assert(shellparam.malloc == 0 && shellparam.nparam == 0); */
while (*argptr) {
OpenPOWER on IntegriCloud