Ich habe ein Problem mit meinen Schleifen. Ich benutze Bash Version 4.1.2.Syntaxfehler - for loop - bash
Mein Code ist folgende:
### List of files to process from the File .txt defined before ###
g=`cat ${AA}.txt | wc -l`
### Number of time the loop has to make calculated with the number of using cores ###
let h=($g/$nproc)
### Loop using $h ###
for i in ((i = 1; i <= ${h}; i++)); do
### Loop to asign every core a process ###
for j in ((j = 1; j <= ${nproc}; j++)); do
command lines to process $file
done
### Wait for every started process to finish ###
wait
done
Die Syntaxfehler ich erhalte, ist:
/var/spool/torque/mom_priv/jobs/1796866.SC: line 57: syntax error near unexpected token `('
/var/spool/torque/mom_priv/jobs/1796866.SC: line 57: `for i in ((i = 1; i <= h; i++)); do'
Gibt es eine Möglichkeit die Schleifen für i und für j zu schreiben anders zu machen Syntax arbeiten ? Dank
https://www.gnu.org/software/bash/manual/bashref.html#Looping-Constructs –
entfernen Sie 'i in' und' j in' –
Bitte versuchen Sie http://shellcheck.net/, bevor Sie fragen wir Menschen. – tripleee