How to check what shell is /bin/sh?

Asked by Dimitri John Ledkov

I'm running Karmic

$ /bin/sh --version
GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
$ /bin/bash --version
GNU bash, version 4.0.33(1)-release (i486-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ /bin/dash --version
/bin/dash: Illegal option --
$

So is my /bin/sh bash, dash or someone replaced it by something malicious?

$ dpkg -S /bin/sh
diversion by dash from: /bin/sh
diversion by dash to: /bin/sh.distrib
bash: /bin/sh
$

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dash Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

try:

file `which sh`

I got this output:

andy@D420:~$ file `which sh`
/bin/sh: symbolic link to `dash'

Revision history for this message
Dimitri John Ledkov (xnox) said :
#2

Thanks actionparsnip, that solved my question.

Revision history for this message
Dimitri John Ledkov (xnox) said :
#3

> actionparsnip proposed the following answer:
> try:
>
> file `which sh`
>
> I got this output:
>
> andy@D420:~$ file `which sh`
> /bin/sh: symbolic link to `dash'

$ file `which sh`
/bin/sh: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

This is what I got..... really weird.

I've removed that file (/bin/sh) cause it was bash, same version as in
jaunty. Then I've recreated sym-link & reinstalled both bash and dash
using synaptic.

I guess somewhere my upgrade from jaunty to karmic alphaX and
sub-sequential upgrades didn't go correct.

Thank you =) I was stuck with bash 3.something now I'm with zippy dash =)

Revision history for this message
Dimitri John Ledkov (xnox) said :
#4

LinkedIn
------------

I'd like to add you to my professional network on LinkedIn.

- Dmitrijs Ledkovs

Confirm that you know Dmitrijs Ledkovs
https://www.linkedin.com/e/isd/1067433081/xUcdUgqj/

------
(c) 2010, LinkedIn Corporation