aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-04-14 04:48:34 -0500
committerRob Landley <rob@landley.net>2020-04-14 04:48:34 -0500
commit97af31fd7a9e5b35b98d65e5d64ef00b5ff7d0b5 (patch)
tree492751565d2855cb33dd4866a077841bd19bf5e9
parent754581fb1faf4c541fdfaddd6bb682c949d09477 (diff)
downloadtoybox-97af31fd7a9e5b35b98d65e5d64ef00b5ff7d0b5.tar.gz
Implement $''
-rw-r--r--toys/pending/sh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/pending/sh.c b/toys/pending/sh.c
index a934ee04..494ed123 100644
--- a/toys/pending/sh.c
+++ b/toys/pending/sh.c
@@ -921,8 +921,8 @@ dprintf(2, "TODO: do math for %.*s\n", kk, s);
}
} else if (cc == '$') {
-// -!_0 "Special Paremeters" ($0 not affected by shift)
-
+// TODO: $_ is last arg of last command, and exported as path to exe run
+// TODO: $! is PID of most recent background job
if (!(cc = str[ii++])) {
new[oo++] = cc;
break;
@@ -957,6 +957,8 @@ dprintf(2, "TODO: do math for %.*s\n", kk, s);
if (kk) kk += TT.shift;
if (kk<TT.arg->c) ifs = TT.arg->v[kk];
} else if (cc=='\'') {
+ for (s = str+ii; *s != '\''; oo += wcrtomb(new+oo, unescape2(&s, 0),0));
+ ii = s-str+1;
} else if (cc == '{') {
// $VARIABLE