I want to output error message on stderr stream like C++, Python whatever can do
how to do it with bash?
eg.
Code: Select all
#!/bin/bash
for f in `ls -R`
do
ls $f > /dev/null
if [ $? -eq 0 ];then
printf "%s: this is not a regular file." $f #how to put this message on stderr stream?
fi
done