#!/bin/sh FILE=$(find -type f -maxdepth 5 | dmenu -c -i -l 10 -p "path to open") # try to execute ./"$FILE"& if [[ $? == 1 ]]; then xdg-open "$FILE" fi