|
#!/bin/bash
if test -x [filename]
then
ls [filename]
fi
if you are doing something else, other than just no enjoying seeing the ls: asdf: No such file or directory message display, such as piping data from tither to thither, like
ls foo | grep -e "bar"
then
ls foo 2>/dev/null | grep -e "bar"
will still display error messages from grep
if you are just using ls to test if a file is there, there is a better away...
|