To my surprise, I found that whether one has the
access command is, indeed distribution-related.
For a more complete solution, and one that gives you a greater working knowledge of Unix/Linux, follow rch1231's solution.
But mine will work on the current working directory if you change it so it doesn't use
access:
Code:
#!/usr/bin/bash
for xxx in *
do
bash -c "cat >> $xxx < /dev/null" 2>/dev/null
if [ $? = 0 ]
then
echo $xxx
fi
done