News:

SMF - Just Installed!

Main Menu

Where do I put scripts to make them work?

Started by mahesh, Oct 05, 2023, 04:02 AM

Previous topic - Next topic

mahesh

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.