LCaraway
LCaraway

Reputation: 1357

Where to save shell scripts on FreeBSD so that they are added to the path?

I have a fairly simple .sh script that can be ran on FreeBSD by the command bash clearlogs.sh arg1. The script takes an integer parameter and simply curses through specified directories and deletes files older that a specified time which is identified as the 1st argument. I was wondering if there was a best practice location to save .sh files as well as the proper way to add them to the path so that any user could simply type clearlogs 7 and that script runs.

Upvotes: 2

Views: 636

Answers (1)

Mateusz Piotrowski
Mateusz Piotrowski

Reputation: 9157

Most programs installed by a local administrator go under /usr/local/bin. This way you can be sure that your script is not going to be discarded during an upgrade. Also, make sure that the script is executable.

You may also consider creating a port for your own use. See the Porter's Handbook for more details. It might be a little bit of an overkill, however.

Upvotes: 1

Related Questions