Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #4552
| From | Jörg Buchholz <bookwood4new@freenet.de> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: command from inside gnuplot |
| Date | 2023-11-08 07:27 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <uif9o5$1fopo$1@dont-email.me> (permalink) |
| References | <uicvon$uk3l$1@dont-email.me> <kqvbqhF5gsmU1@mid.dfncis.de> |
On 07.11.23 18:52, Hans-Bernhard Bröker wrote:
> Am 07.11.2023 um 10:24 schrieb Jörg Buchholz:
>> Hi,
>>
>> i have a problem to use a system command from inside gnuplot.
>>
>> sed -i 's/^\xef\xbb\xbf//' ./process-2023-11-02-13-04-40.csv
>>
>> works at the terminal
>>
>>
>> system "sed -i 's/^\xef\xbb\xbf//' ./process-2023-11-02-13-04-40.csv"
>> and
>> system(sprintf("sed -i 's/^\xef\xbb\xbf//'
>> ./process-2023-11-02-13-04-40.csv"))
>
> Unfortunately this suffers from a lack of escaping. Please note that
> "strings in double quotes" go through some pre-processing in gnuplot,
> including backslash escape substitution done to them before being used.
> So if you want literal backslashes, they have to be escaped. See "help
> quote" for the details.
>
> What that means is that
>
> system "sed -i 's/^\\xef\\xbb\\xbf//' ./process-2023-11-02-13-04-40.csv"
>
> should work better.
>
That's it. Thanks a lot. I was nearby, but use the wrong slash to
escaped backslashes.
Jörg
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar
command from inside gnuplot Jörg Buchholz <bookwood4new@freenet.de> - 2023-11-07 10:24 +0100
Re: command from inside gnuplot Chris Elvidge <chris@mshome.net> - 2023-11-07 10:16 +0000
Re: command from inside gnuplot Hans-Bernhard Bröker <HBBroeker@gmail.com> - 2023-11-07 18:52 +0100
Re: command from inside gnuplot Jörg Buchholz <bookwood4new@freenet.de> - 2023-11-08 07:27 +0100
csiph-web