I have the following simple bash script:
for VAR
do
echo file found $VAR
done
what I want is for it to print all the files that contain the extension .png. I would expect the following command line to work, but it does not. Why?
ls *.png | myscript.sh
or
./myscript.sh < `ls *.png`
lswill be available to myscript.sh as its standard input, not as a variable.