KSH questions

Larry W. Virden lwv at n8emr.UUCP
Sat Feb 13 00:40:17 AEST 1988


The first question is a 'technique' question.  I would like to have a series
of aliases, etc initialized for each interactive shell that I invoke (whether
it is under a terminal, pseudo terminal, etc.).  I would like to have a SUBSET
of these aliases in effect for each korn shell command that I execute.

I cannot look to see if stdin is a tty, since this is true if I execute a
ksh command without redirecting stdin - right or wrong?  I tried looking at
PPID but pseudo ttys and subshells within  my login shell, screen commands, etc.
all get messed up.  If there isnt any easy way, doesnt it seem like there SHOULD
be?

The next question is probably  just a hack by someone, but I dont really know
how to start.  I am looking for a public domain program which would allow me
to expand arguments in the same manner as the csk {} metacharacters work.  For
instance, in csh, if one says "wc -l ab{bc,de}x" you get "wc -l abbcx abdex".
I would like to have this, and if possible, something like ab{a-z}.  Note
that the difference between this and ab[a-z] is that the second expands only
to those names which exist.  The first would expand to ALL of the letters in
the range for instance, whether they exist or not.  This would make generation
of unique alphabetic file names easier, as well as some other applications
that I would like to have.

The two preferred ways of getting this would be a) as ksh hacks, or b) as a
ksh function.  A separate program would be okay, though the overhead might be
too much.

Finally, anyone know of some patches to cause the following two ksh glitches
to go away:
a) When I log into my home system, I often get the following message:       
ksh: : invalid identifier

the .profile terminates and I get the ksh prompt.  Note that the lsat things
being done were simple assignments i=/abc/xyz ; export i and so forth.

b) I have an alias r 'fc -e -' which I use to rerun previous commands.  When I want
to do argument replacemetn (which I consider to be one of the few substandard
parts of ksh) I can only substitute for strings which begin with alphabetics.
I cannot for instance say r tail +10=+20 - I get an error which says +10=+20
not found.
-- 
Larry W. Virden	 75046,606 (CIS)
674 Falls Place, Reynoldsburg, OH 43068 (614) 864-8817
cbosgd!n8emr!lwv (UUCP) 	cbosgd!n8emr!lwv at PSUVAX1 (BITNET)
We haven't inherited the world from our parents, but borrowed it from our children.



More information about the Comp.unix.questions mailing list