comparison moefetch.sh @ 212:da4c03c7377c

fix: count folder doesn't work on empty folder (messed up when removing 'cd' usage)
author edhoprima@gmail.com <edhoprima@gmail.com>
date Mon, 29 Jun 2009 17:35:43 +0000
parents fbb93733098e
children dd95cf01602c
comparison
equal deleted inserted replaced
211:fbb93733098e 212:da4c03c7377c
48 ### - sanity checking 48 ### - sanity checking
49 ### WILL BE FOR 0.3 49 ### WILL BE FOR 0.3
50 50
51 # useless welcome message. Also version 51 # useless welcome message. Also version
52 Msg_Welcome() { 52 Msg_Welcome() {
53 MOEFETCHVERSION="0.2" 53 MOEFETCHVERSION="0.2.1"
54 cat <<EOF 54 cat <<EOF
55 moefetch ${MOEFETCHVERSION} 55 moefetch ${MOEFETCHVERSION}
56 Copyright (c) 2009 edogawaconan <me@myconan.net> 56 Copyright (c) 2009 edogawaconan <me@myconan.net>
57 57
58 EOF 58 EOF
121 121
122 # getting rid of ls (as per suggestion) 122 # getting rid of ls (as per suggestion)
123 Count_Files() { 123 Count_Files() {
124 _i=0 124 _i=0
125 for _f in "${*}/"* "${*}/".*; do 125 for _f in "${*}/"* "${*}/".*; do
126 if [ "${_f}" != '*' ] || [ -e "${_f}" ]; then 126 if [ "${_f}" != "${*}/"'*' ] || [ -e "${_f}" ]; then
127 _i=$((_i + 1)) 127 _i=$((_i + 1))
128 fi 128 fi
129 done 129 done
130 echo $((_i - 2)) 130 echo $((_i - 2))
131 } 131 }