multi-line export without a newlinemake grep output without trailing newlineconcatenate two files without...
Taxi Services at Didcot
Using "subway" as name for London Underground?
Winning Strategy for the Magician and his Apprentice
Using a found spellbook as a Sorcerer-Wizard multiclass
Compiling c files on ubuntu and using the executable on Windows
Confusion about off peak timings of London trains
How to build suspense or so to establish and justify xenophobia of characters in the eyes of the reader?
The eyes have it
How do governments keep track of their issued currency?
Was the output of the C64 SID chip 8 bit sound?
Soft question: Examples where lack of mathematical rigour cause security breaches?
How did they achieve the Gunslinger's shining eye effect in Westworld?
Payment instructions allegedly from HomeAway look fishy to me
Can anyone identify this tank?
Is open-sourcing the code of a webapp not recommended?
Preventing Employees from either switching to Competitors or Opening Their Own Business
Movie about a boy who was born old and grew young
Watts vs. Volt Amps
Russian equivalents of "no love lost"
Are there downsides to using std::string as a buffer?
Was there a priest on the Titanic who stayed on the ship giving confession to as many as he could?
How to retract an idea already pitched to an employer?
Why would future John risk sending back a T-800 to save his younger self?
Trapping Rain Water
multi-line export without a newline
make grep output without trailing newlineconcatenate two files without adding a newlineHow to put a newline special character into a file using the echo command and redirection operator?Add a newline into a filename with `mv`“export VAR=thing && someCommand” reports “export: `&&': not a valid identifier”Why do many tools emit `VAR=value; export VAR` instead of `export VAR=value`?Shortcut for line continuation (escaped newline) actionWhy does number of backslashes increase in strace as opposed to being reduced by bash rules?What does “newline” mean in the bash documentation?Automatically export shell/bash functions
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
How can I export something that's multiline?
export foo='bar a ab ai ii bar'
and put that on two different lines without a newline literal?
export foo='bar a ab ai
ii bar'
perhaps with a backslash?
export foo='bar a ab ai
ii bar'
is this safe?
bash shell environment-variables newlines
add a comment |
How can I export something that's multiline?
export foo='bar a ab ai ii bar'
and put that on two different lines without a newline literal?
export foo='bar a ab ai
ii bar'
perhaps with a backslash?
export foo='bar a ab ai
ii bar'
is this safe?
bash shell environment-variables newlines
1
In the end, do you want$foo
to contain one or two lines (0 or 1 newline characters)?
– Stéphane Chazelas
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago
add a comment |
How can I export something that's multiline?
export foo='bar a ab ai ii bar'
and put that on two different lines without a newline literal?
export foo='bar a ab ai
ii bar'
perhaps with a backslash?
export foo='bar a ab ai
ii bar'
is this safe?
bash shell environment-variables newlines
How can I export something that's multiline?
export foo='bar a ab ai ii bar'
and put that on two different lines without a newline literal?
export foo='bar a ab ai
ii bar'
perhaps with a backslash?
export foo='bar a ab ai
ii bar'
is this safe?
bash shell environment-variables newlines
bash shell environment-variables newlines
edited 1 hour ago
muru
38.7k592168
38.7k592168
asked 1 hour ago
Alexander MillsAlexander Mills
2,42221963
2,42221963
1
In the end, do you want$foo
to contain one or two lines (0 or 1 newline characters)?
– Stéphane Chazelas
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago
add a comment |
1
In the end, do you want$foo
to contain one or two lines (0 or 1 newline characters)?
– Stéphane Chazelas
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago
1
1
In the end, do you want
$foo
to contain one or two lines (0 or 1 newline characters)?– Stéphane Chazelas
1 hour ago
In the end, do you want
$foo
to contain one or two lines (0 or 1 newline characters)?– Stéphane Chazelas
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
Using within a single-quote block clearly doesn't work.
$ export foo='bar a ab ai
ii bar'
$ echo "$foo"
bar a ab ai
ii bar
You could use double quotes.
$ export foo="bar a ab ai
ii bar"
$ echo "$foo"
bar a ab ai ii bar
Or you could put it outside of the single quotes.
$ export foo='bar a ab ai'
' ii bar'
$ echo "$foo"
bar a ab ai ii bar
I'm not sure what you mean by "safe".
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f522744%2fmulti-line-export-without-a-newline%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Using within a single-quote block clearly doesn't work.
$ export foo='bar a ab ai
ii bar'
$ echo "$foo"
bar a ab ai
ii bar
You could use double quotes.
$ export foo="bar a ab ai
ii bar"
$ echo "$foo"
bar a ab ai ii bar
Or you could put it outside of the single quotes.
$ export foo='bar a ab ai'
' ii bar'
$ echo "$foo"
bar a ab ai ii bar
I'm not sure what you mean by "safe".
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
add a comment |
Using within a single-quote block clearly doesn't work.
$ export foo='bar a ab ai
ii bar'
$ echo "$foo"
bar a ab ai
ii bar
You could use double quotes.
$ export foo="bar a ab ai
ii bar"
$ echo "$foo"
bar a ab ai ii bar
Or you could put it outside of the single quotes.
$ export foo='bar a ab ai'
' ii bar'
$ echo "$foo"
bar a ab ai ii bar
I'm not sure what you mean by "safe".
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
add a comment |
Using within a single-quote block clearly doesn't work.
$ export foo='bar a ab ai
ii bar'
$ echo "$foo"
bar a ab ai
ii bar
You could use double quotes.
$ export foo="bar a ab ai
ii bar"
$ echo "$foo"
bar a ab ai ii bar
Or you could put it outside of the single quotes.
$ export foo='bar a ab ai'
' ii bar'
$ echo "$foo"
bar a ab ai ii bar
I'm not sure what you mean by "safe".
Using within a single-quote block clearly doesn't work.
$ export foo='bar a ab ai
ii bar'
$ echo "$foo"
bar a ab ai
ii bar
You could use double quotes.
$ export foo="bar a ab ai
ii bar"
$ echo "$foo"
bar a ab ai ii bar
Or you could put it outside of the single quotes.
$ export foo='bar a ab ai'
' ii bar'
$ echo "$foo"
bar a ab ai ii bar
I'm not sure what you mean by "safe".
edited 1 hour ago
answered 1 hour ago
SparhawkSparhawk
10.7k848102
10.7k848102
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
add a comment |
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
by safe means always works
– Alexander Mills
1 hour ago
by safe means always works
– Alexander Mills
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
@AlexanderMills What specifically do you mean by "always works"? This will always work for two strings.
– Sparhawk
1 hour ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f522744%2fmulti-line-export-without-a-newline%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
In the end, do you want
$foo
to contain one or two lines (0 or 1 newline characters)?– Stéphane Chazelas
1 hour ago
I don't want any newlines yeah
– Alexander Mills
1 hour ago