diff options
author | Singustromo <singustromo@disroot.org> | 2023-11-07 22:14:48 +0100 |
---|---|---|
committer | Singustromo <singustromo@disroot.org> | 2023-11-07 22:14:48 +0100 |
commit | e639d79b27c68f7fb89dd9c48dfdef0c35fc49e5 (patch) | |
tree | 87065857432527a1413cfc2f145edf1ce3c1b841 | |
parent | ffe7e173fdffaae1300d1cd7e8cd0df7ae445045 (diff) | |
download | radio-sh-e639d79b27c68f7fb89dd9c48dfdef0c35fc49e5.tar.gz radio-sh-e639d79b27c68f7fb89dd9c48dfdef0c35fc49e5.zip |
Simplified Sys:log() logic
-rwxr-xr-x | radio | 9 | ||||
-rw-r--r-- | todo.org | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/radio b/radio index fd38439..27d0c81 100755 --- a/radio +++ b/radio @@ -57,12 +57,11 @@ Sys:log() { { [ "$_debug" == '1' ] && [ -n "$*" ]; } || return local i=2 - local out="(${FUNCNAME[1]}:${BASH_LINENO[1]}) [caller: " + local out="(${FUNCNAME[1]}:${BASH_LINENO[1]}) [caller: ${FUNCNAME[i++]}<" - while [ -n "${FUNCNAME[$i]}" ]; do # caller functions - [ "${FUNCNAME[$i]}" = "${FUNCNAME[$((i-1))]}" ] \ - && { i=$(( ${#BASH_LINENO[@]} )); break; } # recursive functions - out+="${FUNCNAME[$i]}<" + while [ -n "${FUNCNAME[i]}" ]; do # caller functions + [ "${FUNCNAME[i]}" = "${FUNCNAME[$((i-1))]}" ] && break + out+="${FUNCNAME[i]}<" ((i++)) done out="${out::-1}] " diff --git a/todo.org b/todo.org index e2ccdc4..de28ac1 100644 --- a/todo.org +++ b/todo.org @@ -30,8 +30,9 @@ - check total runtime of all calls - most occur through get_property() - check where array modification can be simplified - - echo "${a[@]:1:3}" - - print 2nd through 4th elements; ie: the 3 elements + - ${a[@]:1:3} + - 2nd through 4th elements; ie: the 3 elements +- menu: display station name from configuration * TODO ~ radio script 2.2 |