I'm using FreeBSD with bash as the shell. I also use SSH with both FreeNAS and pfSense, both FreeBSD based.
I'm getting confused about setting up bash options, and some clarification would really help. I'm trying to get various shell options to be used in future sessions (and exported to shells called from sessions) but I'm not having much luck. Perhaps I don't know how to find the correct file to put them in, or the correct way to put them there.
My main problem is probably just finding the rc file used for the session (!!)
If I login as root, then execute su
, then set
will show me a different list of environment variables. But as I haven't changed user, I'm confused why my rc file doesn't seem to be the same. (the files I've found don't have different entries for the environment variables I'm looking at). The output of set
shows ENV=/USERNAME/.shrc
but when I edit this file and log back in, I don't see any changes to my session so I'm guessing this isn't where to look? But I've tied editing ~/.bashrc
as well, and that doesn't seem to do anything either.
There should be a way to find out directly which .rc file was used to initiate the session, but I don't know how to do this, especially as both FreeNAS and pfSense might have their own customised locations.
Whether it's using one or two rc files, how can I find which rc file I would have to edit, to modify future sessions that are the same as the present session? And does it use one rc file or two different files if you first login as root and then su
?