The “./” forces it to look current directory only.
/root is not a place I’d recommend.
There’s a pretty standard place to put “personal” scripts/programs in your home directory at ~/bin. A standard user login script sees this directory and automatically adds it to $PATH. All you need do it stick 'em in there and make them executable. This goes way back in Linux.
@fixit7 - Also, your dir Scripts command lists the CleanUp.sh script as being inside the Scripts folder, but you’re running it from the current directory.
Assuming that the /root/Scripts thing is correct (which is weird anyway), try running it like
./Scripts/CleanUp.sh
Edit: I reread the original post, and yeah, I think just removing the ./ should work. Also make sure your script is executable. However, I agree with the rest that using ~/bin is the right way to go
Great! Since you’re familiar with $PATH you can verify it gets added.
That “./” is specific in a lot of procedures but depends on the directory you are in at the time so NOT universal. In fact it bypasses $PATH. Just wanted to clarify.