gnuplot redirect data to a here-doc


gnuplot redirect data to a here-doc



This command works properly to write the results to the file "oneMonthDataOnlyfile.txt"


system("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" ." > oneMonthDataOnly.txt" );



Can I do the redirect to a here-doc, e.g.:


system("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" . "> $myData);



When I try with the above formatting I get "parenthesis expected"



or withsystem("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" ." > $myData " );
sh: $myData: ambiguous redirect
ambiguous redirect


system("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" ." > $myData " );



or: system("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" > $myData);
throws: "Column number or datablock line expected


system("/usr/bin/sed -e '1,3d' " . "oneMonthData.txt" > $myData);



Am I getting the formatting wrong or can a here-doc not be populated this way?




1 Answer
1



Try this:


set print $myData
print system("whatever command you like")
unset print






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages