I had a problem With Nautilus Starred file:
If I run a script.sh from sidebar/Starred the working directory is/home/user and not the directory of the script, as a symbolic link.
My script delete unwanted file in his own directory, I used it many time without problem from his location, but launched from sidebar/Starred, it deleted all my /home/user.
Fortunately I recently made a backup. I corrected my script, now I use $(dirname -- "$(readlink -f – "$0")";)"
Perhaps there is a way to avoid this risk.
In Ubuntu 24.04/24.10, can you confirm it same in other OS?