Quellcode durchsuchen

Apply ShellCheck hints

Alois Mahdal vor 9 Jahren
Ursprung
Commit
4e992fa8a3
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 1
    1
      dotfiles/bash/head.bashrc
  2. 4
    4
      dotfiles/bash/post.bashrc

+ 1
- 1
dotfiles/bash/head.bashrc Datei anzeigen

9
   "${HOME}/.bash/host/$(hostname -s).bashrc" \
9
   "${HOME}/.bash/host/$(hostname -s).bashrc" \
10
   "${HOME}/.bash/post.bashrc";
10
   "${HOME}/.bash/post.bashrc";
11
 do
11
 do
12
-  test -f $include && . $include;
12
+  test -f "$include" && . "$include";
13
 done
13
 done

+ 4
- 4
dotfiles/bash/post.bashrc Datei anzeigen

10
 
10
 
11
 __make_ps1d() {
11
 __make_ps1d() {
12
     local rvfile="$RV_TMP/$$.lastrv"
12
     local rvfile="$RV_TMP/$$.lastrv"
13
-    local lastrv=$(cat $rvfile)
13
+    local lastrv="$(cat "$rvfile")"
14
     local do_rm=false
14
     local do_rm=false
15
     test "$1" == "-r" && do_rm=true
15
     test "$1" == "-r" && do_rm=true
16
-    if [ 0$lastrv -gt 0 ];
16
+    if [ "0$lastrv" -gt 0 ];
17
     then
17
     then
18
         echo "!$lastrv!"
18
         echo "!$lastrv!"
19
     else
19
     else
20
         echo ""
20
         echo ""
21
     fi
21
     fi
22
-    $do_rm && rm -f $rvfile
22
+    $do_rm && rm -f "$rvfile"
23
 }
23
 }
24
 
24
 
25
 __save_rv() {
25
 __save_rv() {
26
     local rvfile="$RV_TMP/$$.lastrv"
26
     local rvfile="$RV_TMP/$$.lastrv"
27
-    [ -w ${rvfile%/*} ] && echo $1 > $rvfile
27
+    [ -w "${rvfile%/*}" ] && echo "$1" > "$rvfile"
28
 }
28
 }
29
 
29
 
30
 make_ps1() {
30
 make_ps1() {