Skip to content

Commit 02c41de

Browse files
bash arithmetic
1 parent 59676ac commit 02c41de

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

scripts/motd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function color (){
1010
function extend (){
1111

1212
local str="$1"
13-
let spaces=60-${#1}
13+
(( spaces = 60 - ${#1} ))
1414
while (( spaces > 0 )); do
1515
str="$str "
1616
(( --spaces ))

scripts/secureDelete.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ for i in "$@"; do
105105
dd if=/dev/zero of="$file" bs=$blocksize count=$flength
106106
# Fill with zeros.
107107
sync # Flush buffers yet again.
108-
let "pass_count += 1"
108+
(( ++pass_count ))
109109
echo
110110
done
111111

scripts/sortedArrayCounter.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ arr=()
1717
for i in $PATH; do
1818
ls $i &>/dev/null
1919
if [[ $? == 0 ]]; then
20-
let "sum += $(ls $i | wc -w)"
20+
(( sum += "$(ls $i | wc -w)" ))
2121

2222
IFS="$oldifs"
2323
for i in $(ls $i); do

0 commit comments

Comments
 (0)