|
From: | Robert E. Griffith |
Subject: | Re: tokenize honoring quotes |
Date: | Fri, 5 Aug 2022 15:54:19 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
str='echo "hello $(ls >/dev/tty) World"'Is there anything without using eval? I played around with passing it through printf's %q but that renders the whole string escaped so it become just one token again.
--BobG On 8/5/22 14:32, Chet Ramey wrote:
Some variant of this: str='echo "hello world"' declare -a a eval a=\( "$str" \) declare -p a
[Prev in Thread] | Current Thread | [Next in Thread] |