Shells and Libraries Problems
-
I am using Nagios to view some data I'm interested in from my pfsense firewall and when building some new plugins, I've been using bash.
I installed bash by deploying it with FreeRadius as I am going to eventually turn this on, and so far I've been able to get data I wanted by using bash scripts, including working around some quirks like the filesystem hiding things between csh and bash.
However, now I am stuck with a plugin I am trying to write and have three questions:
-
Why is it that directories or scripts created in the csh shell or bash shell are invisible to the other? i.e. if I create a directory through the csh shell of /usr/local/myscripts and switch to the bash shell, an ls of /usr/local doesn't see it?
-
Would installing bash via pkg resolve the above problems instead of it being part of the FreeRadius package deployment?
-
Specifically I am trying to use curl with its –interface flag for something specific - and in csh the command works fine but under bash it errors for a shared library not being found, even if I switch to bash before using the pkg install. Is there any fix for this? I've tried creating a script within bash that uses #!/bin/csh but it still errors for the same way.
Thanks for any help I might get.
-
-
0/ When you install something with the tcsh crap, you need to type "rehash". I certainly wouldn't write any scripts for this thing.
1/ Why don't you write a generic POSIX-compatible sh script? Does it seriously need to be bash-specific? -
0/ When you install something with the tcsh crap, you need to type "rehash". I certainly wouldn't write any scripts for this thing.
1/ Why don't you write a generic POSIX-compatible sh script? Does it seriously need to be bash-specific?- I wasn't aware of this. I'll keep it in mind.
- Doesn't have to be bash specific - just where most of my experience is. And originally I was looking at using tcsh but found a few references that suggested not to.
Thanks for the rehash tip though. I'll let you know how it all goes.
-
Ended up using a standard POSIX script to get what I wanted.
Thanks for the tips overall Dok!
-
Glad that it works. ;)