PDA

View Full Version : How to make an .sh run in Terminal



Nubbix
2017-03-28, 23:50
I know, not the most interesting question.

But I made an update.sh that I want to NOT have to type ./update.sh to after navigating into the directory everytime.
I chmod it but it still won't open in Terminal. When I try to choose open with: I cannot find terminal?

So I tried to add it to PATH and further more follow this page http://linuxcommand.org/lc3_wss0010.php
but I don't know where .bash_profile or .profile file to make it last.

My issue is that I rather want to just double click it on desktop to make it execute?

How do I do this?

S4M43L
2017-03-29, 03:11
Make sure your .sh is correct and works from command line.
Then you can edit your DE options to open it with double click, or add it to crontables or /etc/init.d/ to run it i.e when system boots.
Besides, whats your problem with terminal? You wont do much on kali with just double-clicking.

Nubbix
2017-03-29, 22:46
Hi, thanks

Nothing wrong with my terminal, it works there.
But it is an update script to apt-get and I do not want to type in the ./update.sh as I would then need to have the script in the root so I would not need to navigate to a perticular folder.
Time consuming!!!

I want to execute from desktop or place the script in the menu somehow, ease of use.
What is DE options?

PS. here is the content of the file

!#/bin/bash

apt-get update
apt-get upgrade -y
apt-get autoremove