chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a01bd6
)
bash_profile: Split check-for-program code into its own function.
author
Mark Wooding
<mdw@distorted.org.uk>
Tue, 13 Feb 2007 23:56:38 +0000
(23:56 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Tue, 13 Feb 2007 23:56:38 +0000
(23:56 +0000)
I'll want this later on.
bash_profile
patch
|
blob
|
blame
|
history
diff --git
a/bash_profile
b/bash_profile
index 22931b0de487c285dbe67655887352477e3db7a7..287f3cbed2f5fc1a2ebe3b557102d55f6f198d0a 100644
(file)
--- 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