aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 00:20:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 00:20:28 +1200
commit23a05c1d2d7210f9dbfb6682dcdb0e59deb21455 (patch)
tree76beeaa040be0999974c5402d1212564df36cf2f
parentChange mkmv/mkcp from Bash funcs to sh scripts (diff)
downloaddotfiles-23a05c1d2d7210f9dbfb6682dcdb0e59deb21455.tar.gz
dotfiles-23a05c1d2d7210f9dbfb6682dcdb0e59deb21455.zip
Change ca from Bash func to sh script
-rw-r--r--README.markdown2
-rw-r--r--bash/bashrc.d/ca.bash4
-rwxr-xr-xbin/ca3
-rw-r--r--man/man1/ca.113
-rw-r--r--man/man1/mkmv.119
5 files changed, 17 insertions, 24 deletions
diff --git a/README.markdown b/README.markdown
index edc2f1eb..5ed70723 100644
--- a/README.markdown
+++ b/README.markdown
@@ -182,7 +182,6 @@ There are a few other little tricks in `bash/bashrc.d`, including:
* `apf` -- Prepend arguments to a command with ones read from a file
* `bd` -- Change into a named ancestor of the current directory
-* `ca` -- Count given arguments
* `cf` -- Count files in a given directory
* `fnl` -- Run a command and save its output and error into temporary files
* `hgrep` -- `HISTFILE` search
@@ -300,6 +299,7 @@ Installed by the `install-bin` target:
`man(1)` reader for RFCs
* `ax(1)` evaluates an awk expression given on the command line; intended as
a quick way to test how Awk would interpret a given expression.
+* `ca(1)` prints a count of its given arguments.
* `dub(1)` lists the biggest entries in a directory.
* `edda(1)` provides a means to run `ed(1)` over a set of files preserving
any options, mostly useful for scripts.
diff --git a/bash/bashrc.d/ca.bash b/bash/bashrc.d/ca.bash
deleted file mode 100644
index 819cae4c..00000000
--- a/bash/bashrc.d/ca.bash
+++ /dev/null
@@ -1,4 +0,0 @@
-# Count arguments
-ca() {
- printf '%u\n' "$#"
-}
diff --git a/bin/ca b/bin/ca
new file mode 100755
index 00000000..836299ce
--- /dev/null
+++ b/bin/ca
@@ -0,0 +1,3 @@
+#!/bin/sh
+# Print a count of the number of arguments
+printf '%u\n' "$#"
diff --git a/man/man1/ca.1 b/man/man1/ca.1
new file mode 100644
index 00000000..1d79d62e
--- /dev/null
+++ b/man/man1/ca.1
@@ -0,0 +1,13 @@
+.TH CA 1 "July 2016" "Manual page for ca"
+.SH NAME
+.B ca
+\- print a count of the given arguments
+.SH SYNOPSIS
+.B ca
+arg1 arg2 arg3
+.SH DESCRIPTION
+.B ca
+counts all its arguments and prints the count. Useful for quickly counting a
+glob expansion.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/mkmv.1 b/man/man1/mkmv.1
deleted file mode 100644
index 20679db2..00000000
--- a/man/man1/mkmv.1
+++ /dev/null
@@ -1,19 +0,0 @@
-.TH MKMV 1 "July 2016" "Manual page for mkmv"
-.SH NAME
-.B mkmv
-\- create last argument as directory and move remaining arguments into it
-.SH SYNOPSIS
-.B mkmv
-filea fileb newdir
-.br
-.B mkmv
-filea fileb newdir/newsubdir
-.SH DESCRIPTION
-.B mkmv
-combines mkdir(1) and mv(1) into one call, creating the last argument as a
-directory and moving the remaining arguments into it. If the directory creation
-fails, the script stops before attempting to move the files.
-.SH SEE ALSO
-mkdir(1), mv(1), mkcp(1)
-.SH AUTHOR
-Tom Ryder <tom@sanctum.geek.nz>