From daaf92ba4860108d81839185b146d37fb0da5f35 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 27 Dec 2018 02:06:18 -0500 Subject: 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. --- (limited to 'tools') 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 -- cgit v0.9.1