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
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.
yes, it is bash
. To run a script you have to type ./script_name
or sh script_name
-
-
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 -
-
1"sh" is a symlink to
dash
, so "sh script_name" should be "bash script_name" if you want to use bashisms. Nov 16, 2010 at 21:30 -
2Yes, you can install any shell you want. Just use sudo aptitude install ksh Nov 16, 2010 at 21:47