getListing () {
if [ "$1" = ""];
then
alcListDir ~/Projects/Haskell/ -f \
| alcSortPath time | tac | xargs -n1 basename
else
alcListDir ~/Projects/Haskell/"$1"/ -f \
| alcSortPath time | tac | xargs -n1 basename | sed -e "s/^/"$1"\//"
fi
}
The above is giving me an error (when run with set -x) of:
+./rofi.sh:29> getListing ''
+getListing:1> [ '' '=' ']'
getListing:1: parse error: condition expected:
I'm invoking the function like so: getListing ""
What is the cause of the error?