Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deprecate $n & $s parameters in favor of $# & $?

  • Loading branch information...
commit cb4bb90b4033757e1a20a2746c422493ecce6734 1 parent 310c58b
@JNeitzel authored
Showing with 9 additions and 5 deletions.
  1. +3 −1 CHANGES
  2. +4 −2 osh.1
  3. +2 −2 osh.c
View
4 CHANGES
@@ -18,6 +18,8 @@ osh:
* Added $? (as a synonym for $s) parameter.
+ * Deprecated $n and $s parameters in favor of $# and $?.
+
* Changed quoting to allow $ substitution within double (") quotes.
For example: "$$", "$*", "$1", and so forth. This makes parameter
and variable substitution much more flexible.
@@ -1734,6 +1736,6 @@ goto.c:
* All releases of osh prior to and including 020214 were authored
and maintained by Gunnar Ritter.
-Jeffrey Allen Neitzel 2012/02/24
+Jeffrey Allen Neitzel 2012/02/27
@(#)$Id$
View
6 osh.1
@@ -610,13 +610,15 @@ The value of the environment variable HOME.
The value of the environment variable MANPATH.
.TP
\fB$\fR\fIn\fR (*)
-A synonym for the \fB$\fR\fI#\fR parameter.
+A synonym for the \fB$\fR\fI#\fR parameter;
+\fB$\fR\fIn\fR is deprecated.
.TP
\fB$\fR\fIp\fR
The value of the environment variable PATH.
.TP
\fB$\fR\fIs\fR (*)
-A synonym for the \fB$\fR\fI?\fR parameter.
+A synonym for the \fB$\fR\fI?\fR parameter;
+\fB$\fR\fIs\fR is deprecated.
.TP
\fB$\fR\fIt\fR
The terminal name with which the standard input
View
4 osh.c
@@ -908,7 +908,7 @@ get_dolp(int c)
v = dolbuf;
break;
case HASH:
- case 'n':
+ case 'n': /* NOTE: $n is deprecated. */
n = (dolc > 1) ? dolc - 1 : 0;
r = snprintf(dolbuf, sizeof(dolbuf), "%u", (unsigned)n);
v = (r < 0 || r >= (int)sizeof(dolbuf)) ? NULL : dolbuf;
@@ -918,7 +918,7 @@ get_dolp(int c)
v = dolbuf;
break;
case QUESTION:
- case 's':
+ case 's': /* NOTE: $s is deprecated. */
r = snprintf(dolbuf, sizeof(dolbuf), "%u", (unsigned)status);
v = (r < 0 || r >= (int)sizeof(dolbuf)) ? NULL : dolbuf;
break;
Please sign in to comment.
Something went wrong with that request. Please try again.