Skip to content

Commit d0a8545

Browse files
DEBUG: Escape escape characters in some debug output [#103]
1 parent 3859f9e commit d0a8545

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/rsc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
### rsc config --full
6464
### rsc log
6565
###
66-
### Version: 0.16.0-9003
66+
### Version: 0.16.0-9004
6767
### Copyright: Henrik Bengtsson (2022-2024) and Harry Putnam (2022)
6868
### License: ISC
6969

@@ -389,7 +389,7 @@ function remove_stray_pid_file {
389389
warn_if_check_pid_needs_ssh "${rserver_hostname}"
390390
mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1)
391391
okay=$?
392-
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='${res[*]}'"
392+
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'"
393393
relay_condition "${res[@]}"
394394
mapfile -t res < <(prune_debug "${res[@]}")
395395

@@ -686,10 +686,11 @@ function rs_process_status {
686686
warn_if_check_pid_needs_ssh "${hostname}"
687687
mapfile -t res < <(check_pid "${pid}" "${rserver_hostname}" 2>&1)
688688
okay=$?
689-
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='${res[*]}'"
689+
mdebug " - check_pid('${pid}', '${rserver_hostname}') exit code: ${okay}, output='$(printf "%q" "${res[*]}")'"
690690
mapfile -t res < <(prune_debug "${res[@]}")
691-
mdebug " - prune_debug(): ${res[*]}"
691+
mdebug " - prune_debug(): '$(printf "%q" "${res[*]}")'"
692692
if [[ -n "${res[0]}" ]]; then
693+
mdebug " - pid='$(printf "%q" "${res[0]}")'"
693694
pid="${res[0]}"
694695
else
695696
pid=0

0 commit comments

Comments
 (0)