How to check if a filename in a directory starts with a certain string

view full story

http://www.unix.com – Hello, Trying to iterate over set of file in current directory and check if the file name in that folder matches certain string. This is what I have so far. Here I am checking if the file name starts with nexus, if so echo file name to log file. Getting weird syntax errors. Any help is appreciated Code: for filename in ./*  do          if [ -f "$filename" ];        then             file="${filename#*/}";             if [["$file"==* (HowTos)