2016-08-02 10 views
0

は私が多品種Minは Mnetgenの助けを借りて流れインスタンスをコスト作成したいが、私は最初の行、これまで私がやったMnetgen:bashファイルと構文エラー - バグはどこにありますか?

# Batch file for generating MMCF problems with the mnetgen random generator 
# 
# For each n in {64, 128, 256} generates 12 instances for each pair (n, k) 
# with k in {4, 8, 16 , ... , n}, using as input the parameters found 
# in pr{n}.{k}/{n}-{k}-{h}.inp for h in {1, ... , 12}. The instances 
# are left in the directory pr{n}.{k} 
# 
# At the end of the file, commented out, there are the instructions for 
# generating the groups with n = 512 and n = 768: in the latter case, 
# however, only 6 instances for each group are generated. 
# 
# In a Unix environment, simply type "source batch" or "csh < batch" 

foreach i (64) 
foreach j (4 8 16 32 64) 
foreach h (1 2 3 4 5 6 7 8 9 10 11 12) 

mnetgen pr$i.$j/$i-$j-$h.inp pr$i.$j/$i-$j-$h 

end 
end 
end 
... 

によって与えられている「バッチ」と呼ばれるファイルに問題がありますか?最初にエラーを避けるために#include <cstring>mnetgen.cに追加しました。次に、makeと入力して実行可能ファイルmnetgenを取得しました。最後のステップは、バッチファイルを使用してインスタンスを生成することです。最後のコメント行にヒントを使用して

私は、私はそれをどのように修正することができますいずれか

bash: batch: Zeile 14: Syntaxfehler beim unerwarteten Wort »(«
bash: batch: Zeile 14: 'foreach i (64)'

または

mnetgen: Command not found.

を取得しますか?

答えて

0

bashでcshシェルを実行しようとしています。あなたのコマンドを実行している場合

#!/bin/csh 

、UNIX/Linuxは、と見られる最初の行をチェックします:どちらか、それを修正

csh myshell 

を実行するか、最初の行に追加するには

マジックナンバーの一種で、接頭辞は/bin/cshです。

と見つからなかったあなたのmnetgenコマンドのために、私はあなたのスクリプトの中で、あなたのコマンドのフルパスを追加したり、それをシステムに追加することを示唆している(多分#!/bin/env cshとすることを行うには良い方法があります)パス。

+0

ありがとうございました!最初の行に '#!/ bin/csh'を、パスに' mnetgen'を追加し、 'csh Rorschach

関連する問題