aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-12 13:27:21 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-12 13:27:21 +0200
commit7c72e9b9b2d200a4ff7914c88cd6652211cd6133 (patch)
tree3d9b4e876a281d68c444281996fb25d9d0601334
parent03d827e2fbc409ef97829f25b8eeca5204f81a3c (diff)
downloadxutil-7c72e9b9b2d200a4ff7914c88cd6652211cd6133.tar.gz
Remove each
I wasn't entirely happy with it.
-rwxr-xr-xeach18
-rw-r--r--each.156
2 files changed, 0 insertions, 74 deletions
diff --git a/each b/each
deleted file mode 100755
index b1e5727..0000000
--- a/each
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/perl
-
-$i = 0;
-for (@ARGV) {
- if (/^;$/) { $command .= '; '; next; }
- if (/^&&$/) { $command .= '&& '; next; }
- if (/^\|\|$/) { $command .= '|| '; next; }
- if (/^\|$/) { $command .= '| '; next; }
- s/"/"'"'"/g;
- s/\$/\\\$/g;
- s/\\\$\+/\$/g;
- $command .= "\"$_\" "
-}
-
-while (<STDIN>) {
- chomp($ENV{x} = $_);
- system($command);
-}
diff --git a/each.1 b/each.1
deleted file mode 100644
index 00780be..0000000
--- a/each.1
+++ /dev/null
@@ -1,56 +0,0 @@
-.Dd $Mdocdate$
-.Dt each 1
-.Os
-.
-.Sh NAME
-.Nm each
-.Nd do with each line
-.
-.Sh SYNOPSIS
-.Nm each
-.Ar command
-.Op Ar separator command ...
-.
-.Sh DESCIPTION
-.Pp
-.Nm
-runs each given
-.Ar command
-for every line read on standard input.
-.Ar separator
-is one of
-.Ql \&; ,
-.Ql | ,
-.Ql &&
-and
-.Ql || .
-.Pp
-Within a command, the contents of the line is assigned to the variable
-.Ev x ,
-which can be accessed with the normal shell variable interpolation syntax,
-except you need to put a plus sign after the dollar sign:
-.Bd -literal -offset indent
-$+x
-$+{x}
-$+{x#/}
-$+{x%.mp3}
-$+{x%%.*}
-.Ed
-.Pp
-This syntax generally doesn't need to be quoted
-when entered in the Bourne or Korn shells
-(unless you need to put commas inside the curly braces
-or have files whose names begin with
-.Ql $+ ) .
-.Sh AUTHORS
-.Pp
-.Nm
-is written by John Ankarström
-.Aq Mt john (at) ankarstrom.se .
-.Sh BUGS
-.Pp
-It is not possible to insert a literal
-.Ql $+ .
-Quoting it with a backslash prevents the interpolation,
-but results in the literal string
-.Ql $ .