Neorion Posted March 21, 2004 Report Share Posted March 21, 2004 Hey all, I am a newbie in linux. Im running mandrake 10.0 community. I am also a programmer. I was wandering what language is most useful in linux. such as in shell scripts Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted March 21, 2004 Report Share Posted March 21, 2004 Well to begin with Shell Script is its own language. Beyond that, I would probably list the languages in the following order: 1. Perl 2. Python 3. Ruby 4. C This does not include languages like C++ or Java as they tend to be a little heavy when it comes to scripting. Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 21, 2004 Report Share Posted March 21, 2004 don't forget PHP! ;) Quote Link to comment Share on other sites More sharing options...
Neorion Posted March 22, 2004 Author Report Share Posted March 22, 2004 Thanks alot . I know 3/5 of the listed langueages. I was just wandering if there was like a universal shell language. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted March 22, 2004 Report Share Posted March 22, 2004 Yes there is. It's called bash scripting. If you google you'll find lots of info on bash scripting techniques: http://www.ibiblio.org/mdw/HOWTO/Bash-Prog...ntro-HOWTO.html There's one for starters. Quote Link to comment Share on other sites More sharing options...
Qchem Posted March 22, 2004 Report Share Posted March 22, 2004 I wouldn't call bash scripting universal - especially as many people like to use other shells. That said bash is the default shell in most distros.... Which scripting language is most useful obviously depends on what you want to do, IME you can't go wrong with bash and perl. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted March 22, 2004 Report Share Posted March 22, 2004 That said bash is the default shell in most distros.... I can't think of one where bash isn't the default shell. I'm curious, is there some linux distro out there using something other than bash for the default shell? Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted March 23, 2004 Report Share Posted March 23, 2004 Thanks alot . I know 3/5 of the listed langueages. I was just wandering if there was like a universal shell language. There is, it is called Shell Script, of which bash is simply a form. There is also C shell, Korn Shell, and a few others. All of which are available to Linux (although, not always installed by default). However, all of these shells use a form of Shell Script. Bash is simply the most popular when it comes to Linux. (However, it is not necessarily the most powerfull or the easiest to use.) However, with all that said, Shell Script is not always the easiest, or most efficient, language to use. For an example of Shell Script, take a look at your .profile or .bashrc file. This is simply a Shell Script. Shell Script is composed of a combination of the commands that you use at the command line like mv, cp, grep, cat, find, and all the rest working together with various programming constructs like if statements and loops. Generally, you use things like if statements and loops to control the input and the output of various Linux commands. Quote Link to comment Share on other sites More sharing options...
Qchem Posted March 23, 2004 Report Share Posted March 23, 2004 I can't think of one where bash isn't the default shell. I'm curious, is there some linux distro out there using something other than bash for the default shell? It's not a Linux distro but Tru64 UNIX (v5.1) seems to install ksh as the default shell, and thats proper ksh not pdksh that you get with most distros. Quote Link to comment Share on other sites More sharing options...
aRTee Posted March 23, 2004 Report Share Posted March 23, 2004 Here at work we also use ksh a lot, HP-UX. The difference with the PDksh is actually very annoying in the move toward linux - and yes, that's where we're going, for compute servers at least. Anyway, somewhere along the line in Linux development, the Bourne Again SHell was chosen to be the main shell. I think it may not even be possible to run any distro without it, unless you rewrite a lot to exclude it, and it is afaik always present on a distribution. Quote Link to comment Share on other sites More sharing options...
aru Posted March 23, 2004 Report Share Posted March 23, 2004 (edited) However, it is not necessarily the most powerfull or the easiest to use IMHO you are half right, it is NOT the most powerfull, since that price belongs to zsh; but it IS the easier to use because (or at least since) it is the DEFAULT one, at least in LINUX. Old UNIXes, which some are still used but quickly wiped out by linux, used and/or use csh or 'sh' variations such as ksh, tcsh..., but now-a-days GNU-bash is the 'de facto' standard shell and the most used in shell scripting (or dirty programming). One good source of info and resources is the usenet group comp.unix.shell the habitat of shell gurus more shell examples doing cat /etc/shells ~# cat /etc/shells # /etc/shells: valid login shells /bin/ash /bin/bash /bin/csh /bin/sh /usr/bin/es /usr/bin/ksh /bin/ksh /usr/bin/rc /usr/bin/tcsh /bin/tcsh /bin/sash /usr/bin/esh /usr/bin/screen /bin/dash /bin/zsh /usr/bin/zsh Ofcourse you can do shell scripting with which ever language you like as long as it provides you easy, quick and dirty means of writing code (even w/o editors) and as long as it has a good set of system tools or routines. IMHO bash is the best at this since it has a powerful and flexible set of builtin commands and uses the system (really-) power tools in a clean and transparent way, after all it is a system shell :) Other excellent programing languages for shell scripting are Perl (which I don't like, but when comes into dirty-shell scripting is the king) and python (my second preferred language after bash) All is IMHO, and I'm not going to discuss if bash is a full language or not or if it's suitable of comparations with 'real' ones; but when talking about shell scripting it's certainly is the best language. Edited March 23, 2004 by aru Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.