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

    SH shell different than documented?

    Scheduled Pinned Locked Moved General pfSense Questions
    2 Posts 2 Posters 1.1k 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.
    • I
      Imaginos
      last edited by

      In the interest of full disclosure, my sh skills are 20+ year old and it's also entirely possible that I'm a committed idiot, however,

      I cannot get a single sh command evaluation to work at the pfsense shell the way the freebsd sh manual describes.

      At the command prompt, $(/bin/cat /tmp/vpn_ip) works just fine, however, including it elsewhere or in a script such as

      #!/bin/sh
      echo $(/bin/cat /tmp/vpn_ip)

      I forever get 'illegal variable name' and I cannot unravel why. I've tried the $@ and $* flavors, as well as '' and I'm utterly baffled as to what I'm screwing up.

      Final usage will be a modified version of the below

      #!/bin/sh
      /usr/local/bin/curl -d "user=USERNAME&pass=PASSWORD&client_id=$@(/bin/cat ~/.pia_config)&local_ip=$(/bin/cat /tmp/vpn_ip)" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment -o /tmp/vpnportforward

      Also,

      Is there a reference that describes how to change a port alias from the command line?

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        The shell is tcsh, which differs from /bin/sh

        And if you're used to some other OS, /bin/sh there might even be something like bash

        Check the FreeBSD man pages for sh and tcsh to see what syntax works in each.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

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