ref: 9e6e5760761f29ed4be78b08e87fd47c2af0e26a
parent: 281c596acf4eebc74340596481e5d1e8f84f18f1
author: qwx <qwx@sciops.net>
date: Mon Aug 19 06:15:11 EDT 2024
cmd: add ! command: just execute a shell command
--- a/cmd.c
+++ b/cmd.c
@@ -195,6 +195,12 @@
}
static int
+pipeselflessly(char *arg)
+{
+ return pipeline(arg, 0, 0);
+}
+
+static int
replicate(char *)
{
static char u[256];
@@ -260,6 +266,7 @@
case '<': x = pipefrom(s); break;
case '^': x = pipethrough(s); break;
case '|': x = pipeto(s); break;
+ case '!': x = pipeselflessly(s); break;
case 'L': x = setleft(s); break;
case 'R': x = setright(s); break;
case 'c': x = copy(s); break;
--- a/pplay.man
+++ b/pplay.man
@@ -168,6 +168,9 @@
Replace selection or insert at cursor with the contents of
.I file
.TP
+.BI !\ cmd
+Execute shell command without any i/o
+.TP
.BI w\ file
Write selection to
.I file