aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-27 01:48:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-27 01:48:25 +1300
commitb4958f0dbef0c4df8f47e8a603b813994784795b (patch)
treeec422ddb5c18e5d9b03d757debd76939cf57bffa
parentMerge branch 'master' into port/bsd/freebsd (diff)
parentPut exit value of previous command in ksh PS1 (diff)
downloaddotfiles-b4958f0dbef0c4df8f47e8a603b813994784795b.tar.gz
dotfiles-b4958f0dbef0c4df8f47e8a603b813994784795b.zip
Merge branch 'master' into port/bsd/freebsd
-rw-r--r--ISSUES.markdown2
-rw-r--r--README.markdown2
-rwxr-xr-xbin/ix4
-rwxr-xr-xbin/spr4
-rw-r--r--ksh/kshrc.d/prompt.ksh18
-rw-r--r--man/man1/clog.1df2
-rw-r--r--man/man1/edda.1df2
-rw-r--r--man/man1/ix.1df (renamed from man/man1/spr.1df)18
-rw-r--r--man/man1/loc.1df5
9 files changed, 29 insertions, 28 deletions
diff --git a/ISSUES.markdown b/ISSUES.markdown
index 0949c0b6..0434d54e 100644
--- a/ISSUES.markdown
+++ b/ISSUES.markdown
@@ -16,3 +16,5 @@ Known issues
* dr(1df) is probably more practical in awk
* How come commands I fix with the fc builtin always seem to exit 1 even if
they succeed? Did I do that or is it Bash?
+* Wouldn't be too hard to add some HTTP BASIC auth to ix(1df) to make pastes
+ manageable
diff --git a/README.markdown b/README.markdown
index 6949a29b..109af073 100644
--- a/README.markdown
+++ b/README.markdown
@@ -448,6 +448,7 @@ Installed by the `install-bin` target:
that don't actually worry you, exiting with 0 anyway.
* `isgr(1df)` quietly tests whether the given directory appears to be a Git
repository.
+* `ix(1df)` posts its input to the ix.io pastebin.
* `jfc(1df)` adds and commits lazily to a Git repository.
* `jfcd(1df)` watches a directory for changes and runs `jfc(1df)` if it sees
any.
@@ -472,7 +473,6 @@ Installed by the `install-bin` target:
* `shb(1df)` attempts to build shebang lines for scripts from the system
paths.
* `sec(1df)` converts `hh:mm:ss` or `mm:ss` timestamps to seconds.
-* `spr(1df)` posts its input to the sprunge.us pastebin.
* `sqs(1df)` chops off query strings from filenames, usually downloads.
* `sshi(1df)` prints human-readable SSH connection details.
* `stex(1df)` strips extensions from filenames.
diff --git a/bin/ix b/bin/ix
new file mode 100755
index 00000000..45c1f860
--- /dev/null
+++ b/bin/ix
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Convenience script for posting to ix.io pastebin
+cat -- "${@:--}" |
+curl -F 'f:1=<-' http://ix.io/
diff --git a/bin/spr b/bin/spr
deleted file mode 100755
index 8ac846a6..00000000
--- a/bin/spr
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# Convenience script for posting to sprunge.us pastebin
-cat -- "${@:--}" |
-curl -F 'sprunge=<-' http://sprunge.us/
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index fe1f0273..99e193b2 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -18,20 +18,17 @@ function prompt {
PS1=$PS1'$USER@${HOSTNAME%%.*}:'
fi
- # Add sub-commands; working directory with ~ abbreviation, VCS,
- # and job count
- PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)'
-
- # If this is PDKSH, add the exit code of the previous command; this
- # doesn't seem to work on ksh93, probably different timing for when
- # $? is set
- case $KSH_VERSION in
- *'PD KSH'*) PS1=$PS1'$(prompt ret "$?")'
- esac
+ # Add sub-commands; working directory with ~ abbreviation, VCS, job
+ # count, and previous command return value
+ PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)$(prompt ret)'
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'
+ # Add a wrapper around the prompt as determined so far so that the
+ # return value from the previous command doesn't get lost
+ PS1='$(ret=$?;printf %s "'"$PS1"'")'
+
# Add terminating "$" or "#" sign
PS1=$PS1'\$'
@@ -193,7 +190,6 @@ function prompt {
# Show return status of previous command in angle brackets, if not zero
ret)
- typeset ret=$2
((ret)) && printf '<%u>' "$ret"
;;
diff --git a/man/man1/clog.1df b/man/man1/clog.1df
index bb03765d..a0e6d117 100644
--- a/man/man1/clog.1df
+++ b/man/man1/clog.1df
@@ -4,7 +4,9 @@
\- record timestamped logs in a file
.SH SYNOPSIS
.B clog
+.br
getting real tired of all this overengineering
+.br
^D
.SH DESCRIPTION
.B clog
diff --git a/man/man1/edda.1df b/man/man1/edda.1df
index 6c0a8052..c501e571 100644
--- a/man/man1/edda.1df
+++ b/man/man1/edda.1df
@@ -8,7 +8,7 @@
Duplicate any data on stdin into a temporary file, and run ed(1) options over
each of the files given as arguments. Example:
.P
- $ edda /etc/app.d/*.conf <<EOF
+ $ edda /etc/app.d/*.conf <<'EOF'
,s/foo/bar/g
w
EOF
diff --git a/man/man1/spr.1df b/man/man1/ix.1df
index 6f1ae79f..3ce86e96 100644
--- a/man/man1/spr.1df
+++ b/man/man1/ix.1df
@@ -1,23 +1,23 @@
-.TH SPR 1df "July 2016" "Manual page for spr"
+.TH IX 1df "December 2016" "Manual page for ix"
.SH NAME
-.B spr
-\- post input to sprunge.us pastebin and print the URL to stdout
+.B ix
+\- post input to ix.io pastebin and print the URL to stdout
.SH SYNOPSIS
-.B spr
+.B ix
file
.br
-.B spr
+.B ix
file1 file2 file3
.br
declare -p |
-.B spr
+.B ix
.SH DESCRIPTION
-.B spr
+.B ix
uses curl(1) to make an HTTP POST request submitting all of its input (whether
-files or stdin) to the sprunge.us pastebin.
+files or stdin) to the ix.io pastebin.
.SH SEE ALSO
curl(1)
.br
-https://github.com/rupa/sprunge
+http://ix.io/
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/loc.1df b/man/man1/loc.1df
index f288402c..2c3c3a80 100644
--- a/man/man1/loc.1df
+++ b/man/man1/loc.1df
@@ -3,12 +3,13 @@
.B loc
\- find files matching a pattern in the current directory
.SH SYNOPSIS
-.B loc PATTERN1 [PATTERN2...]
+.B loc
+PATTERN1 [PATTERN2...]
.SH DESCRIPTION
.B loc
is a simple wrapper around find(1) which searches in the current directory tree
for filenames matching a pattern, and prints them to stdout, newline-separated.
-It skips dotfiles, and doesn't interate further into a directory if it matches
+It skips dotfiles, and doesn't recurse further into a directory if it matches
the terms. It is intended only for interactive use as a shortcut.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>