> >> I observe some inconsistency with print -s that I don't understand.
> >> In one case a call of
> >>
> >>     x=ABC ; print -s Hihi *.txt $x
> >>
> >> will put unexpanded _literal_ 'Hihi *.txt $x' into the command
> >> history, another time it will put an expanded *.txt file name list
> >> and an expanded $x variable value into the command history.
> >>
> >>
> >
> > I am unable to reproduce this.
> >
> > Since the expansions are done before the shell knows that the command
> > is print -s, I don't know how it is possible to not expand *.txt
> > unless noglob is set or there is no *.txt.
> 
> Janis, what does ls -l print in the directory you test this in? Do you
> have IFS or other variables set in your ~/.kshrc or /etc/ksh.kshrc?

I cannot tell at the moment, since the report was based on a ksh93
on a Cygwin environment that I currently have no access to. From
memory; I inspected all relevant shell-rc and shell-profile settings
but didn't find anything suspicious. IFS was certainly unchanged and
defined as default. Moreover, David's comment says that globbing
and variable expansion would always be expanded, even with the
built-in print command. Compared to external commands, built-ins
*may* behave differently in that respect but David did not confirm
such behaviour. And that puzzles me, since environmental settings
should certainly not influence the behaviour of a ksh built-in in the
case where ksh doesn't handle print in a special way. Your question
with respect to ls -l, I suspect you want to know whether there have
been any txt-files in that directory or whether - in absence of such
files - the *.txt pattern would have been taken literally, I have to say
that there were a couple txt files in the directory, and under certain
reproducable conditions those where expanded, but other times not.
It's really disturbing to type fc -l and find the text 'Hihi *.txt $x', where
(globbing aside for a moment) even the variable $x is not expanded.

I am not sure that is related in any way to the above observation,
but the behaviour of the used ksh93 instance was strange in another
way as well; after some time the shell instance had been closed with
a string "Alarm" on the terminal. And I certainly haven't activated
ksh's [undocumented] alarm feature.

Janis

> 
> Irek
                                          
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to