Path: csiph.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?UTF-8?Q?Hans-Bernhard_Br=C3=B6ker?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: command from inside gnuplot Date: Tue, 7 Nov 2023 18:52:17 +0100 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.dfncis.de iFAl+ANJ7vtIHjH4u8G7bggHhriO1vLvlqHOZxE+nzVJ5hacmOvPjy8hFa Cancel-Lock: sha1:9+gQdf70XvoNbBsgVGYw3f78eyE= sha256:ymwrta2cFEIA1VSbENltdnhd8Yj9q+GB7XO5mnDCuiM= User-Agent: Mozilla Thunderbird Content-Language: de-DE, en-US In-Reply-To: Xref: csiph.com comp.graphics.apps.gnuplot:4551 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.