aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ed.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-12-05 14:29:53 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-12-05 14:29:53 +1300
commit625a12ca063f17021203bd8863d4184c58cb2e0e (patch)
tree35a16b7963fc3fcc551c8a18ec4db6fb12af0fcd /bash/bashrc.d/ed.bash
parentMention pa script (diff)
downloaddotfiles-625a12ca063f17021203bd8863d4184c58cb2e0e.tar.gz
dotfiles-625a12ca063f17021203bd8863d4184c58cb2e0e.zip
Try to use ed -v
Diffstat (limited to 'bash/bashrc.d/ed.bash')
-rw-r--r--bash/bashrc.d/ed.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc.d/ed.bash b/bash/bashrc.d/ed.bash
index 1a7a2b63..5a54c761 100644
--- a/bash/bashrc.d/ed.bash
+++ b/bash/bashrc.d/ed.bash
@@ -1,9 +1,13 @@
# Add a colon prompt to ed when a command is expected rather than text; makes
# it feel a lot more like using ex. Only do this when stdin is a terminal,
-# however.
+# however. Also try and use -v for more verbose error output.
ed() {
if [[ -t 0 ]] ; then
- command ed -p: "$@"
+ if ed -sv - </dev/null >/dev/null 2>&1 ; then
+ command ed -vp: "$@"
+ else
+ command ed -p: "$@"
+ fi
else
command ed "$@"
fi