I have several qustions about the Bash shell, some of which are probably
true also of ksh and maybe other shells. Is there a good, detailed
description/explaination for bash and why certain decisions have been made?
In particular:
1. Bash re-starts history each time it goes into a subshell. I think it
would be much more reasonable to keep a uniform history for a given
login session, even if, for instance, you started the "script" command
to keep track of what you are doing. Or at least a flag that allowed
a single history, even when you run multiple windows. Is there any
documentation or explaination of standards for this, or why one way was
chosen over another?
2. In the emacs editing mode for command lines, in bash, the tab character
is used for command completion, making it VERY difficult to put tabs
into text lines (you have to use "^V" before each tab character. The
problem could be greatly helped by just accepting back-slash or single
quote escape characters, to be consistant with other special characters.
3. In the redhat distribution of Linux, there is something wrong with the
prompt variable, PS1, so that it has to be set in /etc/bashrc. This
means a user has to know enough to set it in their local bashrc, rather
than .bash_profile. Anyone know why this is, and what the problem
Redhat is solving is?
4. The most annoying problem (and I'm pretty sure this in *not* local to
just bash, and may be true in every shell for all I know) has to do
with pipes. WHY ARE BOGUS PIPES ALLOWED without some indication of
of a syntax error??? That is, if someone says:
sort file > newfile | cat newfile
bash (and ksh, I think) accepts this without question. It can lead to
a very subtle error for new users, one they may not even see until
a script goes into production, because it depends on the particular
scheduling algorithms, and the particular load on a given moment. If
you execute a pipeline like this several times, you can see it: sometimes
it will seem to work, and sometimes it will return no output, depending
if the sort finished before or after the cat command.
Why can't the shell put out a warning message (at a minimum) when it
sees stdin or stdout being used around a pipe. A pipe doesn't mean
if either is not being used!
I should say that the reason for these questions has to do with the fact
that I am teaching a beginning UNIX class using Redhat Linux, and the extra
work to get around or explain these problems takes too much class time away
from more important subjects. I've had to write a wrapper for "script" to
keep history working, avoid much use of tabs, ignore some good examples
of how variables work with PS1 (change the variable and it shows up
immediately; go into a subshell (when not exported), and it dissapears, etc),
and spend a lot of times exorting people not to use bogus pipes when the
shell should be telling them directly! I don't know if these are just
oversights in design, if there are good reasons behind them, or something
else.
-- Stan Isaacs
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list