aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 01:41:53 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:09:31 +1200
commit4029cebd2abe02bed49b59052e62097aac2767d3 (patch)
tree2cab2439c5627be3aea1061aafcb8b491f2d0eb7
parentUse terser syntax for .d loop sources (diff)
downloaddotfiles-4029cebd2abe02bed49b59052e62097aac2767d3.tar.gz
dotfiles-4029cebd2abe02bed49b59052e62097aac2767d3.zip
Change pa and paz bash funcs to sh scripts
-rw-r--r--README.markdown4
-rw-r--r--bash/bashrc.d/pa.bash5
-rw-r--r--bash/bashrc.d/paz.bash6
-rwxr-xr-xbin/pa4
-rw-r--r--bin/paz4
-rw-r--r--man/man1/pa.115
-rw-r--r--man/man1/paz.115
7 files changed, 40 insertions, 13 deletions
diff --git a/README.markdown b/README.markdown
index 5ed70723..3e45fc45 100644
--- a/README.markdown
+++ b/README.markdown
@@ -187,9 +187,7 @@ There are a few other little tricks in `bash/bashrc.d`, including:
* `hgrep` -- `HISTFILE` search
* `keep` -- Permanently store ad-hoc shell functions and variables
* `mkcd` -- Create a directory and change into it
-* `pa` -- Print given arguments, one per line
* `path` -- Manage the contents of `PATH` conveniently
-* `paz` -- Print given arguments separated by NULL chars
* `pd` -- Change to the argument's parent directory
* `readv` -- Print names and values from `read` calls to `stderr`
* `readz` -- Alias for `read -d '' -r`
@@ -321,6 +319,8 @@ Installed by the `install-bin` target:
it exits with success or failure. Good for quick tests.
* `mkcp(1)` creates a directory and copies preceding arguments into it
* `mkmv(1)` creates a directory and moves preceding arguments into it
+* `pa(1)` prints its arguments, one per line.
+* `paz(1)` print its arguments terminated by NULL chars.
* `pit(1)` runs its input through a pager if its standard output looks like a
terminal.
* `plmu(1)` retrieves a list of installed modules from
diff --git a/bash/bashrc.d/pa.bash b/bash/bashrc.d/pa.bash
deleted file mode 100644
index b47189bf..00000000
--- a/bash/bashrc.d/pa.bash
+++ /dev/null
@@ -1,5 +0,0 @@
-# Print arguments, one per line. Compare paz().
-pa() {
- (($#)) || return 0
- printf '%s\n' "$@"
-}
diff --git a/bash/bashrc.d/paz.bash b/bash/bashrc.d/paz.bash
deleted file mode 100644
index 77299dad..00000000
--- a/bash/bashrc.d/paz.bash
+++ /dev/null
@@ -1,6 +0,0 @@
-# Print arguments, null-delimited; you will probably want to write this into a
-# file or as part of a pipeline. Compare pa().
-paz() {
- (($#)) || return 0
- printf '%s\0' "$@"
-}
diff --git a/bin/pa b/bin/pa
new file mode 100755
index 00000000..35966464
--- /dev/null
+++ b/bin/pa
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Print arguments, one per line. Compare paz(1).
+[ "$#" -gt 0 ] || return 0
+printf '%s\n' "$@"
diff --git a/bin/paz b/bin/paz
new file mode 100644
index 00000000..679c55f8
--- /dev/null
+++ b/bin/paz
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Print arguments, terminated by null chars. Compare pa(1).
+[ "$#" -gt 0 ] || return 0
+printf '%s\0' "$@"
diff --git a/man/man1/pa.1 b/man/man1/pa.1
new file mode 100644
index 00000000..51eedacd
--- /dev/null
+++ b/man/man1/pa.1
@@ -0,0 +1,15 @@
+.TH PA 1 "July 2016" "Manual page for pa"
+.SH NAME
+.B pa
+\- print the given arguments one per line
+.SH SYNOPSIS
+.B pa
+arg1 arg2 arg3
+.SH DESCRIPTION
+.B pa
+prints each of its arguments followed by a newline. If there are no arguments,
+it does nothing.
+.SH SEE ALSO
+paz(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/paz.1 b/man/man1/paz.1
new file mode 100644
index 00000000..531552f6
--- /dev/null
+++ b/man/man1/paz.1
@@ -0,0 +1,15 @@
+.TH PAZ 1 "July 2016" "Manual page for paz"
+.SH NAME
+.B paz
+\- print the given arguments null-terminated
+.SH SYNOPSIS
+.B paz
+arg1 arg2 arg3
+.SH DESCRIPTION
+.B pa
+prints each of its arguments followed by a null character. If there are no
+arguments, it does nothing.
+.SH SEE ALSO
+pa(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>