From 8aced8ea5080b7e7af76828d0f7edad123b7ac87 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 12 Jun 2011 10:10:58 +0000 Subject: Using more local variables --- pwgrep.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pwgrep.sh') diff --git a/pwgrep.sh b/pwgrep.sh index 4939de8..63df834 100755 --- a/pwgrep.sh +++ b/pwgrep.sh @@ -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 -- cgit v1.2.3