bsd newbie bash question

6 views
Skip to first unread message

DecadentLinux...@decadence.org

unread,
Mar 20, 2020, 11:23:32 AM3/20/20
to
my bash script has trash output, but works fine under linux.

What bash tidbit am I missing?

Hans Selig-Kinn

unread,
Mar 20, 2020, 4:37:51 PM3/20/20
to
On 2020-03-20 15:23:29 +0000, DecadentLinux...@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?

DecadentLinux...@decadence.org

unread,
Mar 20, 2020, 4:55:15 PM3/20/20
to
Hans Selig-Kinn <em...@domain.com> wrote in
news:r539is$16dk$1...@gioia.aioe.org:
it is available from the install script on mine.

Still no reason for it to futz the output.

Goetz Schultz

unread,
May 9, 2020, 6:32:01 AM5/9/20
to
On 20/03/2020 15:23, DecadentLinux...@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.

DoN. Nichols

unread,
May 12, 2020, 5:48:09 PM5/12/20
to
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: <BPdnic...@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 ---
Reply all
Reply to author
Forward
0 new messages