summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 02:06:18 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2018-12-27 02:14:29 (EST)
commitdaaf92ba4860108d81839185b146d37fb0da5f35 (patch)
treec23b95df28ce4b703ff1cec72cca1211f86ee88c /tools
parent3aa9f6158e548f127ee8e4299f67c2275f7d693d (diff)
tools/shman.sh: Remove quotes in parameter expansions
POSIX doesn't list quote removal as one of the expansions to which `word` (in `${parameter#word}` etc.) shall be subjected, but it does mention quoting characters. GNU Bash supports all three quote characters. Almquist shells support backslash, but not single or double quotes.
Diffstat (limited to 'tools')
-rw-r--r--tools/shman.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/shman.sh b/tools/shman.sh
index 70d56c0..df88c95 100644
--- a/tools/shman.sh
+++ b/tools/shman.sh
@@ -55,7 +55,7 @@ get_mtime()
read now_m now_y <<-EOF
$(date '+%m %Y')
EOF
- now_m="${now_m#'0'}"
+ now_m="${now_m#0}"
if [ ${now_m} -ge ${m} ]; then
y=${now_y}
else
@@ -172,7 +172,7 @@ gen_doc()
while read -r line; do
case "${line}" in
'@'*)
- doc_joined="${doc_joined}${LF}${line#'@'}"
+ doc_joined="${doc_joined}${LF}${line#@}"
;;
*)
doc_joined="${doc_joined} ${line}"
@@ -213,15 +213,15 @@ parse_docs()
while IFS='' read -r line; do
case "${line}" in
'##'*)
- doc="${doc}${line#'##'}${LF}"
+ doc="${doc}${line#\#\#}${LF}"
got_doc=true
continue
;;
'')
continue
;;
- *'()') line="${line%'()'}" is_func=true;;
- *'='*) line="${line%%'='*}" is_func=false;;
+ *'()') line="${line%()}" is_func=true;;
+ *'='*) line="${line%%=*}" is_func=false;;
*)
doc=''
got_doc=false