Both commands work just fine when I open the terminal and I type them in myself.
The .sh file is in /home/bin,
I’ve edited the file’s permissions with right click - allow this file to run as a program.
The .sh file’s name is in camelCase.
I have other scripts I use in the bin folder and they work just fine.
What am I doing wrong and what’s the cause of the problem?
( I would’ve posted this in “Newbie corner” if it still existed )
As indicated by the previous poster it’s important to know how you want I execute your script. If you ant to asdociate this with a keybird shortcut I found it useful to run
xterm -e script.sh
Of course you can call the terminal of your choice, and dependent on the terminal you might need to spell out the path to the script. I did thus to call ranger via super + r.
But i admit it also took a lot of experimentation.
If I look at the given command inside the bash script, I would say that you are trying to open two Thunar windows, one at ~/Documents and another at ~/Downloads.
When you are in Thunar you can
click on (select) Documents
hold down the ctrl key
select Downloads
and then right click to get the context menu.
From there, you can either select “Open in 2 New Tabs” or “Open in 2 New Windows”, or “Open With”.
Steps 3-5, could be replaced with a double click of Downloads. A dialog will be displayed with the text, “Are you sure you want to open all folders?”
But program-wise, something you create, I think you might find XFCE Custom Actions helpful.
Where are you trying to execute this script - from Thunar or from the command line (Terminal)?
I have a custom action, which creates a Thunar context menu entry called, “Run Script”. It allows me to right click a script and select this menu item. The custom action command line is xfce4-terminal --hold --command=%f. I believe the default action for a script is edit. These actions are set this way to make sure a user doesn’t accidentally execute a script.