From a6ee71af60c8468fc3931cba2c757438e9252cb0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Dec 2016 00:50:54 +1300 Subject: Add some missing linebreaks --- man/man1/clog.1df | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3 From 9a83f08f55c41a9e2edc274487d5a6e6b14f4fb9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Dec 2016 00:55:24 +1300 Subject: Correct a word --- man/man1/loc.1df | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man1/loc.1df b/man/man1/loc.1df index f288402c..a44f3502 100644 --- a/man/man1/loc.1df +++ b/man/man1/loc.1df @@ -8,7 +8,7 @@ .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 -- cgit v1.2.3 From b6cdff5e6f6fec4972b9f3f884efe1780a368594 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Dec 2016 01:00:42 +1300 Subject: Quote a heredoc delimiter --- man/man1/edda.1df | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 < Date: Mon, 26 Dec 2016 01:00:58 +1300 Subject: Separate args from cmd in loc(1df) manpage --- man/man1/loc.1df | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/man1/loc.1df b/man/man1/loc.1df index a44f3502..2c3c3a80 100644 --- a/man/man1/loc.1df +++ b/man/man1/loc.1df @@ -3,7 +3,8 @@ .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 -- cgit v1.2.3 From 61fa2a0c748537532eb5e5a3e19fbe4cd3eaa01c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Dec 2016 16:46:44 +1300 Subject: Switch to using ix.io pastebin --- README.markdown | 2 +- bin/ix | 4 ++++ bin/spr | 4 ---- man/man1/ix.1df | 23 +++++++++++++++++++++++ man/man1/spr.1df | 23 ----------------------- 5 files changed, 28 insertions(+), 28 deletions(-) create mode 100755 bin/ix delete mode 100755 bin/spr create mode 100644 man/man1/ix.1df delete mode 100644 man/man1/spr.1df 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/man/man1/ix.1df b/man/man1/ix.1df new file mode 100644 index 00000000..3ce86e96 --- /dev/null +++ b/man/man1/ix.1df @@ -0,0 +1,23 @@ +.TH IX 1df "December 2016" "Manual page for ix" +.SH NAME +.B ix +\- post input to ix.io pastebin and print the URL to stdout +.SH SYNOPSIS +.B ix +file +.br +.B ix +file1 file2 file3 +.br +declare -p | +.B ix +.SH DESCRIPTION +.B ix +uses curl(1) to make an HTTP POST request submitting all of its input (whether +files or stdin) to the ix.io pastebin. +.SH SEE ALSO +curl(1) +.br +http://ix.io/ +.SH AUTHOR +Tom Ryder diff --git a/man/man1/spr.1df b/man/man1/spr.1df deleted file mode 100644 index 6f1ae79f..00000000 --- a/man/man1/spr.1df +++ /dev/null @@ -1,23 +0,0 @@ -.TH SPR 1df "July 2016" "Manual page for spr" -.SH NAME -.B spr -\- post input to sprunge.us pastebin and print the URL to stdout -.SH SYNOPSIS -.B spr -file -.br -.B spr -file1 file2 file3 -.br -declare -p | -.B spr -.SH DESCRIPTION -.B spr -uses curl(1) to make an HTTP POST request submitting all of its input (whether -files or stdin) to the sprunge.us pastebin. -.SH SEE ALSO -curl(1) -.br -https://github.com/rupa/sprunge -.SH AUTHOR -Tom Ryder -- cgit v1.2.3 From bd4a681ebe8043471d322c628ee4ca07736a1946 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 26 Dec 2016 16:47:54 +1300 Subject: Add an issue --- ISSUES.markdown | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3 From ce14fceb1080452504184b2e4d5fef142bc5fce5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 27 Dec 2016 01:45:20 +1300 Subject: Put exit value of previous command in ksh PS1 Found a way to do this that seems to work in all the KSHes I've tried --- ksh/kshrc.d/prompt.ksh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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" ;; -- cgit v1.2.3