I'm trying to use a for loop to get the filenames of files that end in .cpp.
Code:
for cppfile in ls *.cpp ; do
echo $cppfile
done
I plan on doing more than just echoing the argument, but as it stands now, it works fine except that I'l get the command as the first arguement. Is there an easy way to avoid this, or will I have to do the loop in another fashion?