fix off by one error when dequoting completed filenames; initial cut at readline identifying ANSI terminals; print coproc commands without coproc name if the coproc is a simple command

This commit is contained in:
Chet Ramey
2023-12-13 10:52:43 -05:00
parent ba57a3e752
commit 9d51df7546
10 changed files with 158 additions and 21 deletions
+2
View File
@@ -157,6 +157,8 @@ hello
world
hello
world
here-doc line 1
here-doc line 2
here-document
here-document
comsub here-string
+19 -9
View File
@@ -16,30 +16,40 @@
shopt -s expand_aliases
# single alias definition contains entire here-document
alias 'foo=cat <<EOF
alias 'heredoc=cat <<EOF
hello
world
EOF'
foo
heredoc
# here-document body continues after alias definition
alias 'foo=cat <<EOF
alias 'headplus=cat <<EOF
hello'
foo
headplus
world
EOF
unalias heredoc headplus
alias head='cat <<END'
head
here-doc line 1
here-doc line 2
END
# here-document delimiter in one alias, body in another
shopt -s expand_aliases
alias c='cat <<\END' d='c
alias head='cat <<\END' body='head
here-document
END'
d
body
# make sure delimiter is recognized whether the alias ends with a newline or not
shopt -s expand_aliases
alias c='cat <<\END' d='c
alias head='cat <<\END' body='head
here-document
END
'
d
body
unalias head body
+5
View File
@@ -134,6 +134,11 @@ EOF
);
echo "coprocs created"
}
mkcoprocs is a function
mkcoprocs ()
{
coproc cat -u - & read -u ${COPROC[0]} msg
}
cat is /bin/cat
cat is aliased to `echo cat'
/bin/cat
+10
View File
@@ -54,3 +54,13 @@ echo "coprocs created"
}
type mkcoprocs
unset -f mkcoprocs
# make sure that simple commands are printed without the coproc name
mkcoprocs ()
{
coproc cat -u - &
read -u ${COPROC[0]} msg
}
type mkcoprocs