when i double click on an executable file, it wont run after i click RUN. i have tried it with a couple of .sh files and some downloaded software, does anyone know why?
a particular .sh file i need to run is a zenity menu. When i try in terminal it just says
sh: Can't open TaskC.sh
thats after i use
sh TaskC.sh
in the file i have used the properties to make it executable and used
chmod 755 TaskC.sh
my code just incase thats the problem
#!/bin/bash
#GUI for TaskB menu
chmod 755 TaskC.sh
temp='mktemp -t temp.XXXXXX'
temp2='mktemp -t temp2.XXXXX'
function software {
sudo get-apt install gparted gnome-desk-utility
zenity --text-info --title "Install Software" --filename=$temp
--width 750 --height 10}
function create {
touch > Desktop/CET103Demo.txt
zenity --text-info --Title "Create CET103Demo.txt" --filename=$temp
--width 300 --height 500}
function delete {
rm Desktop/CET103Demo.txt
zenity --text-info --title "Remove CET103Demo.txt" --filename=$temp
--width 300 --height 500}
function search {
grep -H -r "BASH" /home/mintuser/.profile
zenity --text-info --Title "Search BASH" --filename=$temp
--width 300 --height 500}
while [ 1 ]
do
zenity --list --radiolist --title "TaskC Menu" --column "Select" --column "Menu Selection"
FALSE "Install Software" FALSE "Create file" FALSE "Remove File" FALSE "Search BASH" False "Exit" > $temp2
if [ $? -eq 1 ]
then
break fi
selection ='cat $temp2'
case $selection in
"Install Software")
software;;
"Create File")
create;;
"Remove File")
delete;;
"Search BASH")
search;;
Exit)
break ;; *)
zenity --info "Sorry, invalid selection" esac
done $
many thanks
Try with ./TaskC.sh
You have to be in the same directory than the script, of course. If you want to execute it from anywhere, you need to add it to your PATH (see KevinDTimm's answer)