Browse Source

Do not delete rvfile by default

Alois Mahdal 10 years ago
parent
commit
d792b0f6fd
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      dotfiles/bash/post.bashrc

+ 4
- 2
dotfiles/bash/post.bashrc View File

12
     local rvfile="/var/tmp/bash-rv/$$.lastrv"
12
     local rvfile="/var/tmp/bash-rv/$$.lastrv"
13
     local lastrv
13
     local lastrv
14
     read lastrv <<<$(cat $rvfile 2>/dev/null)
14
     read lastrv <<<$(cat $rvfile 2>/dev/null)
15
+    local do_rm=false
16
+    test "$1" == "-r" && do_rm=true
15
     if [ 0$lastrv -gt 0 ];
17
     if [ 0$lastrv -gt 0 ];
16
     then
18
     then
17
-        echo "$lastrv"
19
+        echo "!$lastrv!"
18
     else
20
     else
19
         echo ""
21
         echo ""
20
     fi
22
     fi
21
-    rm -f $rvfile
23
+    $do_rm && rm -f $rvfile
22
 }
24
 }
23
 
25
 
24
 __save_rv() {
26
 __save_rv() {