Tôi đã viết một chương trình trong IDL để tạo các ô phân tán dựa trên các đối số dòng lệnh. Tôi thành công có thể gọi chương trình trực tiếp tại nhà ga như thế này:Chạy chương trình IDL từ bash với các biến
idl -e "scatterplot_1_2d_file.pro" $infile $outfile $title $xtitle $ytitle $xmin $xmax $ymin $ymax $timescale
đâu $ * tham khảo một số xâu gõ vào Vấn đề là, tôi nghĩ rằng tôi muốn có thể chỉ cần gõ dòng rất, đặt. trong các tên biến thay cho các chữ, thành một tập lệnh bash, và tạo ra một triệu ô phân tán trong khi tôi đang nghỉ. Thật không may, nếu tôi làm điều đó theo cách đó, tôi nhận được thông báo lỗi:
idl: -e option cannot be specified with batch files
Vì vậy, nỗ lực tiếp theo của tôi là cố gắng viết những lệnh để một tập tin batch IDL mà tôi thì muốn chạy.
nỗ lực đó trông như thế này:
#!/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
Tôi không biết nếu phần lớn các lỗi mà kịch bản tạo ra có liên quan, vì vậy tôi sẽ chỉ gửi khi bắt đầu và tôi sẽ gửi phần còn lại sau nếu bạn cần:
[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$
Tôi không biết nếu tôi chỉ đang cố gắng làm điều gì đó không thể làm được, nhưng nó không SEEM thích nó. Lời khuyên nào?
Bạn sẽ phải sửa chữa tất cả các [trích dẫn] (http: // mywiki. wooledge.org/Quotes) lỗi và sửa [xử lý tên tệp] (http://mywiki.wooledge.org/ParsingLs) trước khi chúng tôi có thể đưa ra lời khuyên cụ thể. Nếu bạn bị kẹt sau đó, hãy đăng lỗi mới. – ormaaj