What would be the output of running the following loop in the shell-lesson-data/molecules
directory?
$ for filename in c*
> do
> ls $filename
> done
cubane.pdb
, octane.pdb
and pentane.pdb
are listed.cubane.pdb
is listed.*
matches zero or more characters, so any file name starting with the letter c, followed by zero or more other characters will be matched.
How would the output differ from using this command instead?
$ for filename in *c*
> do
> ls $filename
> done
The same files would be listed.
All the files are listed this time.
No files are listed this time.
The files cubane.pdb
and octane.pdb
will be listed.
Only the file octane.pdb
will be listed.
*
matches zero or more characters, so a file name with zero or more characters before a letter c and zero or more characters after the letter c will be matched.