mardi 12 novembre 2019

Bash If else Read from file

The goal here is when parameters $AutoBasher is set read from file line by line then take that variable and add it to a curl command. I also tried to have it when the parameters is set then run this command, if not then this command. Id like the script to run a one automated command, if not then run command with $URL

AutoBasher()
{
  if [[ -z "$AutoBasher" ]]; then
    echo ''
  else  
    for FileLine in $AutoBasher; do
      while IFS= `read -r Line`; do
    echo ${Line}
      done < "FileLine" 
    done < "$AutoBasher"
  fi
}
curl -i -I -s -k -X $Verb \
   -H "Origin: $TestDomain" \
   $(AccessVerb) \
   $(AccessHeader) \
   $URL $Line $FileLine

Aucun commentaire:

Enregistrer un commentaire