How to add stuff (commands)

I have almost 7 custom Linux/UNIX commands written in SH script (have them on github named "utils"). I have them locally installed on my Linux PC and they work fine. I was wondering how to add them to FreeBSD source, that if anyone installs FreeBSD after adding, they will be able to access the commands as if they were preinstalled. Meaning, the user wouldn't have to download it from the Ports and localize manually.

If you don't understand, I want the commands to be preinstalled in the OS so that it will (and can be) executed after installing right away. Like sudo, csh etc. I would also like them in the Ports so it can be installed if i add more in the future. Please help. Thanks
 
wayes99

First of all, just because a code works well on Linux does not mean it will work the same way on FreeBSD.
Adding your scripts to the basesystem is very unlikely, since basesystem literally only has the basis for the system to function properly. Utilities are inside the package repository.

And note that on FreeBSD, "sudo" is not pre-installed by default as you said, you need to install it via the pkg.

But you can add your scripts to the pkg repository tree, read The Porters Handbook.
 
or you can also:
Create some documentation for your tools (man pages), create a makefile so people can install and uninstall your tools, and give a link to your GitHub. Then people can just clone your repo.
 
So you wrote some scripts (in bash I guess), you don't say what they do, you didn't try them on FreeBSD, you haven't ported them and you demand they will be integrated in the base system?

Funny.
Well, I would make them preinstalled in the base system if I ever succeed in creating my own personal BSD project. Obviously FreeBSD based
 
This link results in a 404 response from github, it does not work. Can you post the correct link?
Hmm this should work, it works for me no error. Try to go to GitHub and search by my username (wayes99) or (WayesPro99) and find it here.
 
I want the commands to be preinstalled in the OS so that it will (and can be) executed after installing right away. Like sudo, csh etc.
sudo(8) isn't included with the base OS. You need to install it separately.

Try to go to GitHub and search by my username (wayes99) or (WayesPro99) and find it here.
Both searches have zero results.
 
sudo(8) isn't included with the base OS. You need to install it separately.


Both searches have zero results.
Seems my account is flagged. and sorry it is wayez99 not wayes99. here are the files :
 

Attachments

First file I look at has #!/bin/bash, that would be a no-go on FreeBSD.

also there's nothing useful or 'new'/unique about those scripts...
any script that constantly needs some manual input (especially "y/n" questions...) is useless as a proper tool. they should always work as a filter to be useful for e.g. other scripts.

also, all of those are extremely limited compared to tools which are already present in base:
- randnum -> jot(1) (maybe combined with rs(1), see the examples section)
- tellfact -> fortune(6)
- passgen -> also jot/rs or openssl-rand(1) e.g. openssl rand -base64 24 (I have a one-liner based on this aliased to 'genpass' in my .cshrc)
- converter -> units(1)
- calc -> bc(1)
 
And can't i use /bin/sh?
sh(1) isn't the same as bash(1). The latter is a sh(1) "work-alike". There have been many binaries used as "sh" over the years (I recall ash(1) -- Almquist's version -- being used in the early 90's). But, there may not be ANYTHING at /bin/bash in a given system. Worse, if your script depends on some subtle difference, someone naively replacing "bash" with "sh" may be surprised with the results.
 
Back
Top