Hello everyone
While reading
In the thread Sourcing - #2 by Peasant I realized something (more)...
This is kind of where I had planed/wanted to see SWARM, among several other situations and places.
And as it seems, it might be a nice idea to do something like a FHS 'wrapper' too.
So one could access the dirs you intend to without knowing which system you're on (by the script of the user).
What is FHS:
- Filesystem Hierarchy Standard
- Linux Filesystem Hierarchy
- https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
- 3.2. Overview of File System Hierarchy Standard (FHS) Red Hat Enterprise Linux 4 | Red Hat Customer Portal
- FilesystemHierarchyStandard - Debian Wiki
- Filesystem Hierarchy Standard | Linux Journal
- Filesystem Hierarchy Standard - Wikipedia
In general, this standard works well, however, there are differences among systems.
For example, but not limited to, some subdirectories of /etc have different names between, say, RH and DEB systems.
This said, I'm aware that the GNU Autoconf-tool does that, so does my project YASSI (Yet Another Simple Script Installer).
Regardless, I'd like to have something I can throw a FHS-compliant string at a command/function and get the accord and proper currents system directory in return - to 'write' variables available to SWARM.
Now I wonder if there is something like that in the GNU core utils that I'm not aware of, or if I'll have to 'move' some code out of YASSI to make a module/function in SWARM.
Hmm.. does any known distro use the prefix echo ${!OS_DIR_*}
?
Or I make it SOS_DIR_* because SWARM_OS_DIR_* seems a bit lengthy.
Or since its BASH based I could used a 'worded' array, like OS_DIRS[bin], OS_DIRS[etc], etc
But wait....
I'm I over-acting now?
I mean, would a 'TUI' wrapper for GNU-Autoconf need to know the system dirs?
I mean, not passing directories, would take the system its default one anyway right?
And if the user wants to pass a directory, well, the user will do an input. so no need to parse/check other than for its existence - to verify a proper(working) input.
What are your thoughts on this please?