Cobra Forum

Linux => New to Ubuntu => Topic started by: mahesh on Oct 05, 2023, 04:02 AM

Title: Where do I put scripts to make them work?
Post by: mahesh on Oct 05, 2023, 04:02 AM
I'm a total noob to scripts and looking for your help, please.

I've written my first script, which looks like this:
     Code:
#! /bin/bash
sudo apt update && sudo apt upgrade && sudo apt autoremove
The script file is right now:
     Code:
/home/macro/upgrade
Permissions are OK (bits set to -rwxr-x--x)

But where should I place the script file?
At this point it doesn't work, as the shell can't find it.
Should I move it to somewhere else?
Or do I need to set an environment variable?

I'm lost.