[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Multiline variables?
From: |
Dan Kegel |
Subject: |
Multiline variables? |
Date: |
Sat, 19 Sep 2020 14:47:24 -0700 |
Hi all!
I innocently used this:
export PUB="$(base64 < ~/.ssh/id_rsa.pub)"
make
where Makefile is
all:
echo "${PUB}"
and it worked fine on Mac, despite PUB being a multiline string.
On Ubuntu (even with the same version of gnu make),
it breaks terribly, complaining about a missing quote
on the end of the first line of the string. Evidently this is not portable.
Clearly, I should use tr -d to remove newlines from the output of base64.
But in a better world, multiline strings would work in this situation.
I couldn't tell why they worked on the mac. Any guesses?
- Dan
- Multiline variables?,
Dan Kegel <=