My official status seems a bit unclear (although I'm getting paid :-) ) but unofficially I keep an eye on a lot of a customers servers. Ad-hoc shell scripts still have similar structure as I know how to 'cut and paste'.

These scripts are run remotely via a 'homegrown' client-server setup. Many should run on different UNIX environments and therefore have near the beginning an OS check. Depending on that I can set PATH and anything else important.

#
# check what type of OS this system runs on
#
OST=`uname -m`
case ${OST} in
"i386")
OST="SCO"
...
;;
"alpha")
OST="ALP"
...
;;
"ia64")
OST="HPU"
...
;;
*)
echo "unknown OS type ${OST} ... \c"
exit 1
;;
esac


On Mon, 27 Dec 2021 at 08:33, Theodore Ts'o <tytso@mit.edu> wrote:
On Sun, Dec 26, 2021 at 02:33:03PM -0700, Warner Losh wrote:
> I have symlinks to all my files. I also have special hooks that I run per
> os and per host to pull in different configs when needed. Though in
> recent years I've not needed it much. I used to do a lot for work like
> this, but these days work envs are close to my home env, so there is little
> point.

I have a bunch of work-specific aliases which get picked up via:

if [ -f $HOME/.bashrc.local ] ; then
   . $HOME/.bashrc.local
fi

I don't keep .bashrc.local under git control, since some of the paths
in those aliases might be considered Work-confidential, so I don't
want to push them out to a personal git repo.

> I've been doing this since RCS days across 5 different SCMs... git makes
> oopses so rare that the paranoia below seems overkill. Though for other
> SCMs it would likely not be paranoid enough.

The backup directory isn't for paranoia, actually.  It's so the first
time that I install my custom dotfiles on a particular machine, if
there is a prexisting dot-file, say, .profile, I copy it to the backup
directory before replacing it with a symlink to the dotfiles repo.

There might be some magic environment variables or PATH setup that is
unique to that particular system's default dot files, so I can take a
quick look at them and see if I might need to extend my generic dot
files, or maybe add something to the ~/.bashrc.local file, or some
such.

                                        - Ted


--
The more I learn the better I understand I know nothing.