Gnuplot + Bash脚本 [英] Gnuplot + bash script

查看:148
本文介绍了Gnuplot + Bash脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以下方面遇到一些问题:

I have some problems with the following:

我想绘制许多数据文件,为此我找到了一个或多或少的好脚本

I would like to plot many data files, and I found a more or less good script for that

#! /bin/bash
ls *.data | sed "s/.data//" > list
for i in `cat list` ; do
   sed -e "s/INPUTFILE/$i/" -e "s/OUTPUTFILE/$i/" \
    plot.gnu | gnuplot
done
rm list

plot.gnu

set term postscript enhanced color
set output 'OUTPUTFILE.eps'
set title 'OUTPUTFILE'
p 'INPUTFILE.data' u 1:2 w l

但是我对此部分有疑问

for i in `cat list` ; do
       sed -e "s/INPUTFILE/$i/" -e "s/OUTPUTFILE/$i/" \
        plot.gnu | gnuplot
    done

某种程度上它无法更新plot.gnu文件...此sed命令无法正常运行...

somehow it cannot update the plot.gnu file as it should be... This sed command does not work properly...

有人可以帮助我解决此问题吗?预先感谢!

Can anyone help me to solve this issue? Thanks in advance!

推荐答案

让我们尝试

for i in `cat list` ; do
   cat plot.gnu | sed "s/\(INPUTFILE\|OUTPUTFILE\)/$i/g" | gnuplot
done

欢呼

这篇关于Gnuplot + Bash脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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