我已經在IDL中編寫了一個程序,用於根據命令行參數生成散點圖。我成功地可以直接調用程序的終端是這樣的:使用變量從bash運行IDL程序
idl -e "scatterplot_1_2d_file.pro" $infile $outfile $title $xtitle $ytitle $xmin $xmax $ymin $ymax $timescale
其中$ *是指在輸入一些字符串常量的問題是,我想我可以只鍵入很行,推杆。在變量名中代替文字,變成bash腳本,並在休息時產生一百萬個散點圖。不幸的是,如果我這樣做的,我得到的錯誤:
idl: -e option cannot be specified with batch files
所以我的下一個嘗試是嘗試寫這些命令的IDL批處理文件,我會再運行。
試圖看起來是這樣的:
#!/bin/bash
indir=/path/to/indir/
outdir=/path/to/outdir/
files=`ls $indir`
batchfile=/path/to/tempbatchfile.pro
echo .r "/path/to/scatterplot_1_2d_file.pro" >> $batchfile
for file in $files
do
name=${file%\.*}
echo scatterplot_1_2d_file $indir$name.txt $outdir$name.jpg $name "Gauge Precipitation (mm)" "NMQ Precipitation (mm)" "*" "*" "*" "*" 2 >> $batchfile
done #done file
echo exit >> $batchfile
idl <<EOF
@/path/to/scatterplot_1_2d_file
EOF
rm $batchfile
我不知道,如果是批量腳本生成是相關的,所以我就發佈了開始,我稍後會後其餘部分的錯誤如果你需要它:
[foo]$ bash script_thing.sh
IDL Version 6.3 (linux x86 m32). (c) 2006, Research Systems, Inc.
Installation number: 91418.
Licensed for personal use by XXXXXXXXX only.
All other use is strictly prohibited.
PRO scatterplot_1_2d_file
^
% Programs can't be compiled from single statement mode.
At: /path/to/scatterplot_1_2d_file.pro, Line 1
% Attempt to subscript ARGS with <INT ( 1)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 2)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 3)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 4)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 5)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 6)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 7)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 8)> is out of range.
% Execution halted at: $MAIN$
% Attempt to subscript ARGS with <INT ( 9)> is out of range.
% Execution halted at: $MAIN$
我不知道,如果我只是試圖做一些事情不能做,但它似乎並不喜歡它。有什麼建議?
你必須修復所有[報價](HTTP:// mywiki。 wooledge.org/Quotes)錯誤,並且糾正[文件名的處理](http://mywiki.wooledge.org/ParsingLs),然後才能給出具體的建議。如果您在此之後卡住,請發佈新錯誤。 – ormaaj