[Tcsh] [UCE] tcsh-6.24.08 is now available
Luke Mewburn
luke at mewburn.net
Mon May 15 12:41:31 UTC 2023
On 23-04-15 11:54, Kimmo Suominen wrote:
| On Sat, 15 Apr 2023 at 11:47, Kimmo Suominen <kim at netbsd.org> wrote:
| > ------------------------
| > > setsid -w sh -c 'tcsh -f -c "echo #no comment"'
| > #no comment
| > > setsid -w sh -c 'tcsh -f -c "echo #no comment"' < /dev/null
| >
| > ------------------------
| >
| > I understand the "$edit" case, but I don't understand the "#no comment" case.
|
| But I guess it has to do with ed_Init() somehow as well, because
| making the shell interactive with the "-i" flag makes a difference:
|
| ------------------------
| : beowulf:~; setsid -w sh -c 'tcsh -f -i -c "echo #no comment"' < /dev/null
| #no comment
| ------------------------
I've investigated this further.
The difference in behaviour is to be expected, and turns out is actually documented:
When the shell's input is not a terminal, the character ‘#’ is taken to
begin a comment. Each ‘#’ and the rest of the input line on which it ap‐
pears is discarded before further parsing.
The mechanism in the testsuite to detect if stdin is a tty or not doesn't
quite work and always causes the test group to be skipped:
AT_CHECK([if [ ! -t 0 ]; then exit 77; fi],, [Skipping comment tests])
probably due to m4 parsing/quoting of if [.
I'll replaced this with something like:
AS_IF([test -t 0], [
# tests when stdin is a tty and not reading from file
], [
# tests when stdin is not a tty or reading from file
])
I've fixed this up in pull request:
https://github.com/tcsh-org/tcsh/pull/75
Then it works if I do:
make check TESTSUITEFLAGS='-k Comments -k edit'
or
make check TESTSUITEFLAGS='-k Comments -k edit' </dev/null
regards,
Luke.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20230515/db720d49/attachment.asc>
More information about the Tcsh
mailing list