Permalink
Browse files

Using bash builtin instead of external commands

* test, [ are limited commands, [[ is built in
** http://mywiki.wooledge.org/BashFAQ/031
  • Loading branch information...
1 parent 371f443 commit fe4eb3d1aa337c41bf374aedf8cd7d4001a91c24 @bahamas10 committed May 25, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/mad
View
@@ -47,8 +47,8 @@ display() {
for path in $paths; do
local file=$path/$page
local ext=$path/$page.md
- test -f $file && display_file $file
- test -f $ext && display_file $ext
+ [[ -f "$file" ]] && display_file $file
+ [[ -f "$ext" ]] && display_file $ext
done
echo
@@ -144,7 +144,7 @@ install_mad() {
# file required
-test $# -eq 0 && display_mad_usage
+[[ -z "$1" ]] && display_mad_usage
# parse args

0 comments on commit fe4eb3d

Please sign in to comment.