Date: Sun, 22 Dec 2024 13:45:19 +1000 From: Martin D Kealey <mar...@kurahaupo.gen.nz> Message-ID: <CAN_U6MUa33ApoymR72NtHFuzei0GWpysVKj=n=cu20rbrv4...@mail.gmail.com>
| But a nagging question is why does the text contain both ' and " | characters? My guess (and that is all it is) is that the answer isn't that it contains both, but that it might contain either. Most likely he is trying to quote an unknown (in advance) string, so nothing in it will be interpreted by the shell. printf %q might be a solution if that is the case (or better in a modern enough bash, %Q). But once again, we have a user seeking assistance with solving a problem they have decided they need to solve, in order to accomplish some other goal, without indicating what they're trying to achieve. We'd all be better off simply refusing to answer questions like that - insist on knowing the actual problem being solved, rather than some minor step that the user has determined is important to deal with - when in most cases if it truly is difficult (this one wasn't, rather there are just so many possible answers that picking which requires more info) then 99% of the time the problem stated never needed solving at all. kre