Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Shells and Libraries Problems

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 2 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jarrad
      last edited by

      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:

      1. 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?

      2. Would installing bash via pkg resolve the above problems instead of it being part of the FreeRadius package deployment?

      3. 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.

      1 Reply Last reply Reply Quote 0
      • D Offline
        doktornotor Banned
        last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • J Offline
          jarrad
          last edited by

          @doktornotor:

          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?

          1. I wasn't aware of this. I'll keep it in mind.
          2. 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.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jarrad
            last edited by

            Ended up using a standard POSIX script to get what I wanted.

            Thanks for the tips overall Dok!

            1 Reply Last reply Reply Quote 0
            • D Offline
              doktornotor Banned
              last edited by

              Glad that it works. ;)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.