bug fix
authorIan Kelling <ian@iankelling.org>
Fri, 25 Apr 2014 19:16:21 +0000 (12:16 -0700)
committerIan Kelling <ian@iankelling.org>
Thu, 4 May 2017 23:40:14 +0000 (16:40 -0700)
.bashrc
path_add-function [moved from path-add-function with 86% similarity]

diff --git a/.bashrc b/.bashrc
index 83eddfb81724bebc3b98f0e155d2c12ee2bda365..99c311cbda9c45c78e2aba30735711ecc9005894 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -31,7 +31,7 @@ done
 
 # so I can share my bashrc
 source $HOME/bin/bash_private
-source $HOME/path-add-function
+source $HOME/path_add-function
 
 
 
@@ -42,7 +42,7 @@ source $HOME/path-add-function
 
 CDPATH=.:/a
 
-path-add /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
+path_add /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
 
 #use extra globing features. See man bash, search extglob.
 shopt -s extglob
@@ -114,8 +114,8 @@ HISTIGNORE="&:?: *"
 
 export BC_LINE_LENGTH=0
 
-path-add /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
-path-add $HOME/bin/bash-programs-by-ian/utils
+path_add /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
+path_add $HOME/bin/bash-programs-by-ian/utils
 # note, if I use a machine I don't want files readable by all users, set
 # umask 077  # If fewer than 4 digits are entered, leading zeros are assumed
 
@@ -260,7 +260,7 @@ distro_name() {
 
 
 dt() {
-    date "+%A, %B %d, %rq" "$@"
+    date "+%A, %B %d, %r" "$@"
 }
 
 
similarity index 86%
rename from path-add-function
rename to path_add-function
index ec41e06acb8f21ac4f05a5297765df6bcdc7d7dc..cc613672b9790c7049eefbac6f837bbfe521b8b0 100644 (file)
@@ -2,10 +2,11 @@
 # no bashisms so it can be used in debian profile run by dash
 # --start adds to start of path, which will give it highest priority
 # --ifexists will add to path only if the directory exists
-path-add() {
+path_add() {
     local found x y z
-    local ifexists=false
-    local start=false
+    local ifexists start
+    ifexists=false
+    start=false
     while [ "$1" = --* ]; do
         if [ "$1" = --start ]; then
             start=true
@@ -22,7 +23,7 @@ path-add() {
         done
         unset IFS
         if ! $found; then
-            if [ $ifexists = false ]  || [ -d $x ]; then
+            if ! $ifexists || [ -d $x ]; then
                 if $start; then
                     PATH="$x:$PATH"
                 else