commit d339561e84808c92d103907665b6404ea5f698d7 parent f4c8f490213fba56fe69c580f0639f5c716578ad Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 2 May 2019 16:31:01 +0200 Escape ()? characters before eval Diffstat:
M | bin/tsp-rerun | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/tsp-rerun b/bin/tsp-rerun @@ -25,8 +25,12 @@ get_tsp_job_command() { tsp | grep "^$1 " | sed 's/ */ /g' | cut -d' ' -f6- } +surround_paranthesis_words_with_ticks() { + sed 's/(/\\(/g; s/)/\\)/g; s/?/\\?/g' +} + handle_id() { - cmd="tsp $(get_tsp_job_command "$1")" + cmd="tsp $(get_tsp_job_command "$1" | surround_paranthesis_words_with_ticks)" [ "$verbose" = 1 ] && echo "$cmd" eval "$cmd" }