use subshell

This commit is contained in:
2025-12-08 16:04:42 -08:00
parent 5dc71de8af
commit fbeff64ed7

View File

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