I have a bash script with -e option set, which fails the whole script on the very first error.
-e
In the script, I am trying to do an ls on a
ls
one solution would be testing the existence of the folder
function myLs() { LIST="" folder=$1 [ "x$folder" = "x" ] && folder="." [ -d $folder ] && LIST=`ls $folder` echo $LIST }
This way bash won't fail if $folder does not exist
$folder