Quote all `local var=...' usages - bookmarks.sh - Simple bookmark manager
(HTM) hg clone https://bitbucket.org/iamleot/bookmarks.sh
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset e4bef0700ea291fe37eb800f7ed4c73d4d1e3b39
(DIR) parent f64cfd7707dd9e69616b19d4111a7efe34de1ae4
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Fri, 19 Oct 2018 21:46:19
Quote all `local var=...' usages
E.g.:
| #!/bin/sh
|
| f()
| {
| foo="foo bar baz"
| local var=$foo
| echo $var
| var=$foo
| echo $var
| }
|
| f
...print:
| foo
| foo bar baz
(...is it intended? Probably not!)
Diffstat:
bookmarks.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff -r f64cfd7707dd -r e4bef0700ea2 bookmarks.sh
--- a/bookmarks.sh Tue Oct 16 10:51:56 2018 +0200
+++ b/bookmarks.sh Fri Oct 19 21:46:19 2018 +0200
@@ -44,10 +44,10 @@
return
fi
- local id=$1
- local url=$2
- local tags=$3
- local comment=$4
+ local id="$1"
+ local url="$2"
+ local tags="$3"
+ local comment="$4"
printf "$id\t$url\t$tags\t$comment\n" >> "${_bookmarks}"
}
@@ -62,7 +62,7 @@
return
fi
- local id=$1
+ local id="$1"
sed -i -e "/^${id} /d" "${_bookmarks}"
}
@@ -87,7 +87,7 @@
return
fi
- local field=$1
+ local field="$1"
case "${field}" in
@*)
@@ -135,7 +135,7 @@
usage
fi
- local action=$1
+ local action="$1"
shift
case "${action}" in