summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-06-12 10:10:58 +0000
committerPaul Buetow <paul@buetow.org>2011-06-12 10:10:58 +0000
commit8aced8ea5080b7e7af76828d0f7edad123b7ac87 (patch)
tree3eed5aac8e90bd3201681a34198242bea1979f00
parentc6d3dc20df1586c67ef116adba66839bd36faa06 (diff)
Using more local variables
-rwxr-xr-xpwgrep.sh9
1 files changed, 5 insertions, 4 deletions
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