An alternative to BASH/TCSH?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers An alternative to BASH/TCSH?
# 8  
Old 08-10-2010
Hi.

See Comparison of command shells - Wikipedia, the free encyclopedia for some additional shells, not all of which are for *nix. Also off the top of my head, es (perhaps no longer supported), psh (perl shell), rexx (and undoubtedly others) ... cheers, drl
# 9  
Old 08-10-2010
Quote:
Originally Posted by Koalaboration
Ah yes, I see some clarification is needed.

The BEST programming/script/anything language is:

1) Simple (i.e. only as complicated as absolutely necessary) (python is simple)
Depends on your point of view. Python is enormous(25 megabytes, at least), spread across jillions of tiny files(takes my system a few seconds to tally that size of 25 megabytes), and opens dozens of files to do absolutely nothing at all. BASH is tiny in comparison.

Python is of course capable of things bash can't do, so it's not a completely fair comparison, but the cost of a 'better' language can be tremendous.
Quote:
2) Intuitive; not necessarily easy to learn. (i.e. implemented logically, syntactically logical, semantically logical) (C is extremely syntactically logical, although semantically it can be a little cryptic)
BASIC's lack of symmetry always bugged me; "why can't I make a routine like PRINT that takes a variable number of arguments", "why can't I save PRINT's output in a variable", etc, etc, etc. C is almost perfect in this regard; C libraries are written in C, hence never have any "magic" syntax. It's very, very hard to make a design as smart as that.
Quote:
3) As good as BASH or TCSH (functionally speaking)
That's doable in just about any language. Functionally speaking, shells aren't that great as languages go except in a few key areas.
Quote:
BASH, while ubiquitous, powerful, and useful, is:

1) Unnecessarily complicated. Its like the English language. We think it simple, because we've learned it by rote, but anyone with an objective opinion (and therefore more valuable scientifically speaking) (i.e. a native non-English speaker) will tell you it makes little sense. Imagine how much faster infants would learn to speak if we used a language that was actually designed to be easy to learn ...
You've got us there. I blame history. They kept nailing features on the side without overhauling the language and now this mess is a defined standard. You've got your single square brackets for doing a few kinds of comparisons via cryptic unguessable keywords, BASH's fancy double square brackets that were supposed to be their modern replacement but sane programmers avoid, your 'expr' builtin for numeric operations, your double-round-brackets also for numeric operations, optionally with $ in case you felt like turning it into a string, your backticks for capturing output, and $(this) kind of construct also for capturing program output... It's no unified whole.

On the other hand, I think its syntax for piping and redirection is about as good as can be expected.
Quote:
2) BASH's cryptic syntax make it look cool, but also make it esoteric, which is a terrible quality for any language to have, as it directly contradicts it purpose.
Well, how wordy do you want it? Shell scripting is one extreme, where the command to run a command is a single keystroke: enter. java might be the other, where you must dig through 9 levels of nested objects to find the system call you want.
Quote:
The PERFECT language would simple require to user to tell the computer what to do, and it would do it. Simple as that. However, BASH is an inadequate stopgap (it's not a good enough alternative in the meantime) Python is much closer, but it's a bit of a pain to write shell scripts in python.

Sometimes I wonder if shell scripts are even necessary, but they so often prove their use, that this though rarely lingers :P

To be honest, I was REALLY hoping someone would say:

"Hey, yeah, why don't you try TPSH (The Perfect Shell) ? Syntactically it's like python, but is semantically implemented via LISP and has features of both. The core functions basically form a wrapper for BASH while the rest incorporate other features like OOP and AOP and more!"
It's a nice thought. I've long wondered what a next-generation shell would look like. How radically can the shell be redesigned and still have "cat foo bar | baz" do what it traditionally did? Traditional redirection's also a syntax I think should be kept. And of course interactivity. Comparisons and numerics should be built into one syntax like in C. A noninteractive language with several steps between writing and testing is a severe barrier to a novice programmer.

Last edited by Corona688; 08-10-2010 at 04:35 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash tcsh Script runs in terminal but not folder

So, I made a script beginning with #!/bin/bash on gedit. And I double clicked it to run in terminal and I end up with "The child process exited normally with status 127" and "command not found". If I run the same script from the terminal as "tcsh (script name)" it runs just fine. If I... (8 Replies)
Discussion started by: OntorEska
8 Replies

2. Shell Programming and Scripting

Tcsh to sh

Dear all, I have piece of command from tcsh, which I would like to be in my .bashrc file. However, I am comletely blank about the tcsh commandline. if (-e ~/forum/dir/code.sh) then source ~/forum/dir/code.sh endif Any piece of suggestions how to convert it to sh way? Thank you emily (5 Replies)
Discussion started by: emily
5 Replies

3. Shell Programming and Scripting

tcsh help

Does anyone no way my .tcsh_history file is filling up with a bunch of crap?? It is filled with lines like: ! ls eccracrascratcd ! ls mecd /hchoo "cratch2/mecd /sch2/mecd /sh2/mecd /scratchcd /scratch2/mecd /scratcraecd /ls mo "ls" > ! ls eccratch2/mecd /sc/ls"d /scratch2/mecd histecho "ls" o... (2 Replies)
Discussion started by: Bic121
2 Replies

4. Shell Programming and Scripting

Bash can't find file but tcsh can why?

I have a short script for compiling an old program. It's a simple text file 'ccprog' created in emacs. The permissions were changed with 'chmod 775 ccprog' to make it an executable. When I try to run ccprog I get "bash: ./ccprog: No such file or directory". If I change to tcsh ccprog runs. Why... (68 Replies)
Discussion started by: muddauber
68 Replies

5. Shell Programming and Scripting

for / foreach syntax issues (in bash or tcsh)

So I am new to unix, and actually anything outside drag and drop with the mouse (been learning for about a week so far) . I have been using the foreach command in tcsh because I am working on a group of files. Basically what I need is to insert part of the filename as the first line in the file.... (0 Replies)
Discussion started by: thepolypore
0 Replies

6. Shell Programming and Scripting

Decimals in TCSH

Hello, I want to run a loop with non-integer values (which I know I can't) so I've created a loop of integers and divided it by 10. However, these values are always rounded down to 1 significant figure. How do I get the script to keep and use the decimal value? My script is as follows #... (1 Reply)
Discussion started by: DFr0st
1 Replies

7. UNIX for Dummies Questions & Answers

$ in sed under tcsh vs bash

In bash, I can match the ' character in a substition involving the line ending symbol $, easily. In tcsh I ran into a problem. Code: sed "s/$/'/g" filename sed "s/$/'/g" < filename sed -e "s/$/'/g" filename Unmatched '. Where can I find out why this is the case? (2 Replies)
Discussion started by: uiop44
2 Replies

8. UNIX for Dummies Questions & Answers

help in tcsh

am working in tcsh while writing a script, what is diff between foll two starting line #!/bin/csh #!/bin/csh -f Also can I use the same line for script in tcsh or I have to necessarily use #!/bin/tcsh I guess even #!/bin/sh will also do. Kindly clarify (3 Replies)
Discussion started by: mahendrakamath
3 Replies

9. Shell Programming and Scripting

Help me with this tcsh script.!!!!

I need to write a tcsh script which would compare files in the two folders and then send me a mail saying which of the files are missing.For eg 1) I have this folder1 containing all the files which must land on folder2 on a daily basis. 2) If a file is present in folder1 but not in... (6 Replies)
Discussion started by: kumarsaravana_s
6 Replies

10. Shell Programming and Scripting

tcsh

I'm working on OpenOffice Localization; In that I need to work most of in 'tcsh' Since I have almost work till now in 'bash', I want to explore 'tcsh' much more .. An body suggest me a way ? books ? Thanks, :) (1 Reply)
Discussion started by: kartik
1 Replies
Login or Register to Ask a Question