aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/read.in
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-08-28 18:27:23 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-08-29 12:48:45 -0700
commit7fce9e2411b9e63d949ad519f1b6a36744d3df4c (patch)
tree42db765cdece36a63a7f699debfc50dd8ebc059c /tests/read.in
parentcc52a59e1ac7155123a314067cc8ad9f3affe491 (diff)
Trim trailing newline on cmdsubst when IFS=''
When $IFS is empty, command substitution no longer splits on newlines. However we still want to trim off a single trailing newline, as most commands will emit a trailing newline and it makes it harder to work with their output.
Diffstat (limited to 'tests/read.in')
-rw-r--r--tests/read.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/read.in b/tests/read.in
index 53f9873b..f8787c5c 100644
--- a/tests/read.in
+++ b/tests/read.in
@@ -7,6 +7,11 @@ set -l IFS \t
count (echo one\ntwo)
set -l IFS
count (echo one\ntwo)
+echo [(echo -n one\ntwo)]
+count (echo one\ntwo\n)
+echo [(echo -n one\ntwo\n)]
+count (echo one\ntwo\n\n)
+echo [(echo -n one\ntwo\n\n)]
set -le IFS
function print_vars --no-scope-shadowing