From 2041672dbfb29ef4baf4a73118edd6bdf8fcc106 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 13 Feb 2007 23:56:38 +0000 Subject: [PATCH] bash_profile: Split check-for-program code into its own function. I'll want this later on. --- bash_profile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash_profile b/bash_profile index 22931b0..287f3cb 100644 --- a/bash_profile +++ b/bash_profile @@ -80,6 +80,10 @@ if [ -d /usr/local/plan9 ]; then $PLAN9/bin fi +# --- Find whether a program exists --- + +__mdw_programp () { type -t >/dev/null "$1"; } + # --- And the same for manual pages --- case "$MACHTIME" in @@ -103,7 +107,7 @@ export QMAILINJECT=c export EDITOR=ed for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do name=`echo $ed | sed 's/ .*$//'` - if type -t >/dev/null "$name"; then + if __mdw_programp "$name"; then EDITOR=$ed break fi -- 2.11.0