bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

here strings fold newlines on MacOS


From: Rich Lafferty
Subject: here strings fold newlines on MacOS
Date: Sat, 30 Jan 2021 17:44:38 -0500

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin18.7.0
Compiler: clang
Compilation CFLAGS: -DSSH_SOURCE_BASHRC
uname output: Darwin flounder.home.mati.ca 18.7.0 Darwin Kernel Version 18.7.0: 
Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin18.7.0

Bash Version: 5.1
Patch Level: 0
Release Status: release

Description:
Here strings ('<<<') fold newlines into spaces on MacOS, but not on Linux,
leading to incompatibilites in bash code expected to work the same on both
platforms.

Repeat-By:

On Linux:

$ od -bc <<< $(echo -e "foo\nbar")
0000000 146 157 157 012 142 141 162 012
 f o o \n b a r \n
0000010

On MacOS:

$ od -bc <<< $(echo -e "foo\nbar")
0000000 146 157 157 040 142 141 162 012
 f o o b a r \n
0000010


reply via email to

[Prev in Thread] Current Thread [Next in Thread]