I can’t identify the error in my script

Asked

Viewed 34 times

1

if [  $#  -eq  1  ]
    then$atletas=$(find  treinos  -maxdepth  1  -mindepth  1  -type  d)
    for  a  in  $atletas
    do
      dados=$(find  $a  -mindepth  1  -maxdepth  1  -type  f  -name  "????-??-??.txt")
      nome=$(echo  $a  |  cut  -f2  -d  "/")
      for  d  in  $dados
      do
        minutos=$(cat  $d  |  grep  "^$1"  |  cut  -f2  -d  ":")
        dia=$(echo  $d  |  cut  -f3  -d  "-"  |  cut  -f1  -d  ".")
        ficheiro="treinos/${1}_${nome}.csv"
        treino="$dia;$minutos"
        echo  $treino  >>  $ficheiro
      done
    done
    else
    echo  "Deve  inserir  exatamente  um  parâmetro!"

fi

1 answer

0

In your script is:

then$atletas=$(find

But the right thing is:

then $atletas=$(find

Browser other questions tagged

You are not signed in. Login or sign up in order to post.