gnuplot的和bash进程替换 [英] gnuplot and bash process substitution

查看:149
本文介绍了gnuplot的和bash进程替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否允许gnuplot的bash进程替换吗?

在gnuplot的我可以做的:

 情节<加入TMP1 TMP2U 2:3

但我不能得到这个工作:

 情节<加入TMP1≤(加入TMP2 TMP3)的u 2:3

如果它工作,或者是不支持的gnuplot bash进程替换吗?

下面有3个例子输入文件:

猫TMP1

  A 1
B 2
的C 3

猫TMP2

  B 3
C
ð6

猫TMP3

  A 4
B 6
-C 8
ð10
Ë12


解决方案

此命令后的< 的popen()执行,它使用 / bin / sh的(见男人popen方法)。所以,你必须调用庆典明确地为了让使用过程替代:

 情节'< EXEC的bash -c加盟TMP1≤(加入TMP2 TMP3)'用2:3

在你的情况跟单替换下面还有会做:

 情节'<加入TMP2 TMP3 |加入TMP1  - '用2:3

Does gnuplot allow bash process substitution?

In gnuplot I can do:

plot "<join tmp1 tmp2" u 2:3

But I can't get this to work:

plot "<join tmp1 <(join tmp2 tmp3)" u 2:3

Should it work, or isn't bash process substitution supported in gnuplot?

Here are 3 example input files:

cat tmp1

A 1
B 2
C 3

cat tmp2

B 3
C
D 6

cat tmp3

A 4
B 6
C 8
D 10
E 12

解决方案

The command following the < is executed with popen(), which uses /bin/sh (see man popen). So you must invoke bash explicitely in order to make use of the process substitution:

plot '< exec bash -c "join tmp1 <(join tmp2 tmp3)"' using 2:3

In your case with the single substitution the following would also do:

plot '< join tmp2 tmp3 | join tmp1 -' using 2:3

这篇关于gnuplot的和bash进程替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆