mardi 21 avril 2015

If syntax shell

I've troubles to understand an if syntax of a line in shell:

if [ ! -f *file1.txt* -a ! -f *file2.txt* -a ! -f *file3.txt* ]; then
    sbatch file.sh
fi

The * is used because my files are backed up to #file.txt.1# format.

As far as I know, the ! creates a 'if not', the -f 'if the string is a file' but I haven't found any function for the -a flag.

I want to submit the file.sh only if all these files are NOT present.

Does anyone could help?

Aucun commentaire:

Enregistrer un commentaire