I preface this by saying I am pretty much a complete noob when it comes to script writing.
Anyway, I am looking to create a script that opens a terminal in the GUI environment of Ubuntu, and when it does, shows the output of the other commands running in the script.
The reason for this is I am looking to take the script, throw it into the directory that runs scripts on log in and have it opening a terminal, run my normal update scripts and then keep the terminal open to allow me to continue after.
My reason is basically to just get more experience, and I figured to automate something I do every time I login.
Best Answer
Make sure your script is executable and add this command to Startup Applications:
This will open
gnome-terminal
, which will start a non-interactivebash
shell (which will runsudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
) and will later replace the current shell with an interactivebash
shell.If you have
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
already in a script, it would probably be more pratical to set Startup Applications to launch the script and maintain the script instead of the command in Startup Applications: