diff options
| author | Paul Buetow <paul@buetow.org> | 2011-06-12 10:10:58 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2011-06-12 10:10:58 +0000 |
| commit | 8aced8ea5080b7e7af76828d0f7edad123b7ac87 (patch) | |
| tree | 3eed5aac8e90bd3201681a34198242bea1979f00 | |
| parent | c6d3dc20df1586c67ef116adba66839bd36faa06 (diff) | |
Using more local variables
| -rwxr-xr-x | pwgrep.sh | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -94,7 +94,7 @@ function error () { } function findbin () { - trylist=$1 + local -r trylist=$1 found="" for bin in $trylist; do if [ -z $found ]; then @@ -132,7 +132,7 @@ function setwipecmd () { } function pwgrep () { - search=$1 + local -r search=$1 if [ -z "$ALL" ]; then dbs=$DB @@ -234,9 +234,10 @@ function pwfcat () { } function pwfadd () { - name=$(echo $1 | sed 's/.gpg$//') + local -r name=$(echo $1 | sed 's/.gpg$//') + local srcfile=$1 + local outfile='' - srcfile=$1 if [ $(echo "$srcfile" | grep -v '^/') ]; then srcfile=$CWD/$srcfile fi |
