Not sure, if that is intentional, but do you really mean "ls *.dat" and not "ls $datafile"? If it's intentional then it's quite easy for novices to fall for that IMHO. ;)