• bsd newbie bash question

    From DecadentLinuxUserNumeroUno@decadenc@21:1/5 to All on Fri Mar 20 15:23:29 2020
    my bash script has trash output, but works fine under linux.

    What bash tidbit am I missing?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DecadentLinuxUserNumeroUno@decadenc@21:1/5 to Hans Selig-Kinn on Fri Mar 20 20:55:11 2020
    Hans Selig-Kinn <email@domain.com> wrote in
    news:r539is$16dk$1@gioia.aioe.org:

    On 2020-03-20 15:23:29 +0000,
    DecadentLinuxUserNumeroUno@decadence.org said:

    my bash script has trash output, but works fine under linux.

    What bash tidbit am I missing?

    Maybe the fact that BSDs don't use bash as default shell?



    it is available from the install script on mine.

    Still no reason for it to futz the output.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Goetz Schultz@21:1/5 to DecadentLinuxUserNumeroUno@decadenc on Sat May 9 11:31:59 2020
    On 20/03/2020 15:23, DecadentLinuxUserNumeroUno@decadence.org wrote:
    my bash script has trash output, but works fine under linux.

    What bash tidbit am I missing?


    Any chance of elaborating on it?

    Cheers
    G.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DoN. Nichols@21:1/5 to Goetz Schultz on Tue May 12 21:47:20 2020
    On 2020-05-09, Goetz Schultz <ng-delete-mailer@goetz.co.uk> wrote:
    On 20/03/2020 15:23, DecadentLinuxUserNumeroUno@decadence.org wrote:
    my bash script has trash output, but works fine under linux.

    What bash tidbit am I missing?


    Any chance of elaborating on it?

    Cheers
    G.

    Among other things -- are you sure you are using bash? The
    /bin/sh in my OBSD 6.0 is linked to:

    26004 -r-xr-xr-x 3 root bin 554K Jul 26 2016 ksh*
    26004 -r-xr-xr-x 3 root bin 554K Jul 26 2016 rksh*

    To find out for sure, start with this:

    which sh (if using tcsh as your personal shell)
    (or "ls /bin/sh" to make sure that is there)

    Once you are sure that sh is in /bin, then this:

    ls -i /bin/sh
    and you should get something like this:

    26004 /bin/sh

    then follow that with

    "ls -i /bin | grep 26004" (or whatever number the previous command gave
    you), and you will see a listing of all the names linked to the
    same file (-i gives you the inode number):

    and get something like:


    ======================================================================
    # ls -i /bin | grep 26004
    26004 ksh
    26004 rksh
    26004 sh
    ======================================================================

    In other words -- all the names which are linked to that one
    file.

    Now -- did you actually install bash from the packages? It is
    not installed by default. And based on the above, if you ran

    /bin/sh /path/to/my/script

    you would be trying to run a bash script in the Korn shell (/bin/ksh),
    and that and bash use different extensions over /bin/sh.

    You have to download it from the OBSD packages site for your
    cpu, and then install it. For OBSD 6.0, a check through there finds
    this as the install for bash:

    bash-4.3.46.tgz

    For that matter -- which linux? For the nearest one to reach,
    (Ubuntu 18.04.2), the default shell is dash, not bash, nor ksh, nor
    zsh).

    Good Luck,
    DoN.

    --
    Remove oil spill source from e-mail
    Email: <BPdnicholsBP@d-and-d.com> | (KV4PH) Voice (all times): (703) 938-4564
    (too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
    --- Black Holes are where God is dividing by zero ---

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)