Sujet : Re: Storing a Linux shell command into an AWK variable
De : mortonspam (at) *nospam* gmail.com (Ed Morton)
Groupes : comp.lang.awkDate : 08. Mar 2024, 14:56:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <usf5f2$1nj3v$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 3/7/2024 4:29 AM, Mr. Man-wai Chang wrote:
On 6/3/2024 9:03 pm, Ed Morton wrote:
>
Do not do this. You wouldn't do it in shell (see
https://mywiki.wooledge.org/BashFAQ/050) and you definitely must not do
this in awk as that'll have all of the issues associated with storing
code in a shell variable PLUS additional issues of robustness and
efficiency related to spawning a subshell to call an external tool from awk.
I undertsand the limitations of Awk. But I was wondering about how far I could go. :)
It's not a limitation of awk any more than trying to dig a ditch with a toothbrush would uncover a limitation of the toothbrush, it's just a matter of using the right tool for the job and awk is not a tool to sequence calls to other tools - that's what a shell is for.
Whatever it is you're trying to do, post a new question with a minimal
complete, verifiable example (see
https://stackoverflow.com/help/minimal-reproducible-example for what
that means) so we can help you do it the right way.
Already done so. My question in the end was more about escaping special/reserved symbols.
No, there is no MCVE anywhere in this thread. Any help you think you're getting is based on guesses and assumptions and any implementation suggestions you got would be similar to getting instructions if you asked how to load a gun while it's pointed at your foot rather than just being told "don't do that" so treat everything with a large pinch of salt as we simply cannot know what it is you're really trying to do given what you've shown us so far.
Ed.