7

Recently started playing with Ubuntu. I am playing with few shell scripts written for Korn Shell that I want to edit in Ubuntu. What shell does Ubuntu runs on? I guess its Bash? If it is, then is there any way to install or run a particular script under a particular shell?

2 Answers 2

8

The default scripting shell (/bin/sh) is dash. The default interactive shell (/bin/bash) is bash. When using scripts on Ubuntu that are using /bin/sh you may need to avoid various "bashisms", like arrays or {}-style globbing.

1

yes, it is bash. To run a script you have to type ./script_name or sh script_name

5
  • Hi Pawel, Can I run a script written from ksh under bash?
    – t3ch
    Nov 16, 2010 at 19:50
  • well, a lot ksh scripts will run without any problems under bash. You simply have to try :) before running a script, it may be necessary to execute command: chmod +x script_name
    – Praweł
    Nov 16, 2010 at 19:57
  • But is it possible to install any other shell?
    – t3ch
    Nov 16, 2010 at 21:14
  • 1
    "sh" is a symlink to dash, so "sh script_name" should be "bash script_name" if you want to use bashisms.
    – Kees Cook
    Nov 16, 2010 at 21:30
  • 2
    Yes, you can install any shell you want. Just use sudo aptitude install ksh Nov 16, 2010 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .