Show stdout containing n with line breaksRemove forced line breaks from fortune output while preserving them for the author lineEcho new line and string beginning tHow to launch a pipe as a persistent processcolor of echo with commandsAdd line breaks to Grep CommandsKeep all line breaks except the last one using awk
Singleton Design Pattern implementation in a not traditional way
Are illustrations in novels frowned upon?
How do applicants for an NSF fellowship come up with a research plan for the research statement part of the applications
Most practical knots for hitching a line to an object while keeping the bitter end as tight as possible, without sag?
Science fiction short story where aliens contact a drunk about Earth's impending destruction
Avoiding racist tropes in fantasy
Did a flight controller ever answer Flight with a no-go?
Algorithms vs LP or MIP
What is the hex versus octal timeline?
Can realistic planetary invasion have any meaningful strategy?
Is there any practical application for performing a double Fourier transform? ...or an inverse Fourier transform on a time-domain input?
Cross-referencing enumerate item
How should I face my manager if I make a mistake because a senior coworker explained something incorrectly to me?
Is a player able to change alignment midway through an adventure?
Accent on í misaligned in bibliography / citation
Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?
How much code would a codegolf golf if a codegolf could golf code?
Defense against attacks using dictionaries
Why can't an Airbus A330 dump fuel in an emergency?
What is the best option for High availability on a data warehouse?
Confirming resignation after resignation letter ripped up
Why is my Earth simulation slower than the reality?
for loop not working in bash
Sun setting in East!
Show stdout containing n with line breaks
Remove forced line breaks from fortune output while preserving them for the author lineEcho new line and string beginning tHow to launch a pipe as a persistent processcolor of echo with commandsAdd line breaks to Grep CommandsKeep all line breaks except the last one using awk
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
The output from an executable (cURL) contains n. How can such output be displayed with line breaks?
Say the output from an executable is tCLn1523 memon
, piping to printf does not show line breaks.
$ echo "tCLn1523 memon"
tCLn1523 memon
$
$ printf "tCLn1523 memon"
tCL
1523 memo
$
$ echo "tCLn1523 memon" | xargs -0 printf '%s'
tCLn1523 memon
$
$ echo "tCLn1523 memon" | awk ' printf "%s", $0
tCLn1523 memon
bash echo newlines
add a comment |
The output from an executable (cURL) contains n. How can such output be displayed with line breaks?
Say the output from an executable is tCLn1523 memon
, piping to printf does not show line breaks.
$ echo "tCLn1523 memon"
tCLn1523 memon
$
$ printf "tCLn1523 memon"
tCL
1523 memo
$
$ echo "tCLn1523 memon" | xargs -0 printf '%s'
tCLn1523 memon
$
$ echo "tCLn1523 memon" | awk ' printf "%s", $0
tCLn1523 memon
bash echo newlines
1
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
1
@Janka: In this case OP actually wantsecho
to not interpret the newlines as they are usingecho
to simulate thecurl
output that needs to be interpreted.
– Jesse_b
Aug 10 at 14:22
add a comment |
The output from an executable (cURL) contains n. How can such output be displayed with line breaks?
Say the output from an executable is tCLn1523 memon
, piping to printf does not show line breaks.
$ echo "tCLn1523 memon"
tCLn1523 memon
$
$ printf "tCLn1523 memon"
tCL
1523 memo
$
$ echo "tCLn1523 memon" | xargs -0 printf '%s'
tCLn1523 memon
$
$ echo "tCLn1523 memon" | awk ' printf "%s", $0
tCLn1523 memon
bash echo newlines
The output from an executable (cURL) contains n. How can such output be displayed with line breaks?
Say the output from an executable is tCLn1523 memon
, piping to printf does not show line breaks.
$ echo "tCLn1523 memon"
tCLn1523 memon
$
$ printf "tCLn1523 memon"
tCL
1523 memo
$
$ echo "tCLn1523 memon" | xargs -0 printf '%s'
tCLn1523 memon
$
$ echo "tCLn1523 memon" | awk ' printf "%s", $0
tCLn1523 memon
bash echo newlines
bash echo newlines
edited Aug 11 at 10:15
ilkkachu
67.2k10 gold badges112 silver badges193 bronze badges
67.2k10 gold badges112 silver badges193 bronze badges
asked Aug 10 at 14:13
SOUserSOUser
2151 silver badge10 bronze badges
2151 silver badge10 bronze badges
1
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
1
@Janka: In this case OP actually wantsecho
to not interpret the newlines as they are usingecho
to simulate thecurl
output that needs to be interpreted.
– Jesse_b
Aug 10 at 14:22
add a comment |
1
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
1
@Janka: In this case OP actually wantsecho
to not interpret the newlines as they are usingecho
to simulate thecurl
output that needs to be interpreted.
– Jesse_b
Aug 10 at 14:22
1
1
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
1
1
@Janka: In this case OP actually wants
echo
to not interpret the newlines as they are using echo
to simulate the curl
output that needs to be interpreted.– Jesse_b
Aug 10 at 14:22
@Janka: In this case OP actually wants
echo
to not interpret the newlines as they are using echo
to simulate the curl
output that needs to be interpreted.– Jesse_b
Aug 10 at 14:22
add a comment |
4 Answers
4
active
oldest
votes
%s
does not interpret escape sequences. You need %b
for that:
% echo 'tCLn1523 memon' | xargs -0 printf "%b"
tCL
1523 memo
%
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
You'll probably have to use the input as the format string, after replacing all%
with%%
– muru
Aug 10 at 14:58
1
@muruprintf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char stringn
in $0 will remain as such even in the context of a printf format string. You could dogsub()
s but then you might run afoul of\n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.
– Ed Morton
Aug 11 at 0:44
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
|
show 1 more comment
You probably need to transform double-backslash to backslash as well, otherwise the input format would be ambiguous.
You can write a sed script to translate backslash-letter escapes. This script only translates the escape sequences that it recognizes and otherwise removes the backslash. I've put in support for newline and tab.
… | sed 's/\n/n/g; s/\t/ /; s/\(.)/1/g'
The whitespace in s/\t/ /
is a tab character. GNU sed lets you write s/\t/t/
.
If you also want octal escapes, use a more advanced tool such as Perl. You can make it parse all the escape sequences that it supports.
… | perl -pe 's/\([0-7]1,3|c.|[oxN][^]+|.)/""\$1""/eeg'
add a comment |
Here's what it'd take to do what you want with awk. Given this input:
$ printf '%sn' 'abc\ndefnghi'
abc\ndefnghi
Note that the first n
is itself escaped and so should be treated literally as \n
. Here's how to get the expected output:
$ printf '%sn' 'abc\ndefnghi' |
awk 'gsub(/@/,"@A"); gsub(/\\/,"@B"); gsub(/\n/,"n"); gsub(/@B/,"\\"); gsub(/@A/,"@")1'
abc\ndef
ghi
If you want other escape sequences interpreted too, e.g. t
, you'd add a separate gsub() for each of those right after the one for n
, e.g.:
awk '
gsub(/@/,"@A"); gsub(/\\/,"@B")
gsub(/\n/,"n")
gsub(/\t/,"t")
gsub(/@B/,"\\"); gsub(/@A/,"@")
1'
Those first 2 and last 2 gsub()s are creating a unique string @B
, mapping \
pairs to it to get them out of the way, and then mapping them back after the intended conversions are done.
add a comment |
Easy enough: echo -e "tCLn1523 memon"
From man echo
:
-e enable interpretation of backslash escapes
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%2f534881%2fshow-stdout-containing-n-with-line-breaks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
%s
does not interpret escape sequences. You need %b
for that:
% echo 'tCLn1523 memon' | xargs -0 printf "%b"
tCL
1523 memo
%
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
You'll probably have to use the input as the format string, after replacing all%
with%%
– muru
Aug 10 at 14:58
1
@muruprintf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char stringn
in $0 will remain as such even in the context of a printf format string. You could dogsub()
s but then you might run afoul of\n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.
– Ed Morton
Aug 11 at 0:44
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
|
show 1 more comment
%s
does not interpret escape sequences. You need %b
for that:
% echo 'tCLn1523 memon' | xargs -0 printf "%b"
tCL
1523 memo
%
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
You'll probably have to use the input as the format string, after replacing all%
with%%
– muru
Aug 10 at 14:58
1
@muruprintf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char stringn
in $0 will remain as such even in the context of a printf format string. You could dogsub()
s but then you might run afoul of\n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.
– Ed Morton
Aug 11 at 0:44
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
|
show 1 more comment
%s
does not interpret escape sequences. You need %b
for that:
% echo 'tCLn1523 memon' | xargs -0 printf "%b"
tCL
1523 memo
%
%s
does not interpret escape sequences. You need %b
for that:
% echo 'tCLn1523 memon' | xargs -0 printf "%b"
tCL
1523 memo
%
answered Aug 10 at 14:30
murumuru
44k5 gold badges110 silver badges181 bronze badges
44k5 gold badges110 silver badges181 bronze badges
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
You'll probably have to use the input as the format string, after replacing all%
with%%
– muru
Aug 10 at 14:58
1
@muruprintf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char stringn
in $0 will remain as such even in the context of a printf format string. You could dogsub()
s but then you might run afoul of\n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.
– Ed Morton
Aug 11 at 0:44
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
|
show 1 more comment
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
You'll probably have to use the input as the format string, after replacing all%
with%%
– muru
Aug 10 at 14:58
1
@muruprintf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char stringn
in $0 will remain as such even in the context of a printf format string. You could dogsub()
s but then you might run afoul of\n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.
– Ed Morton
Aug 11 at 0:44
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
2
2
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
Nice one! I still think command substitution would be better than xargs though, no?
– Jesse_b
Aug 10 at 14:32
1
1
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
Possibly. In either case the entire output ends up as an argument, and with command substitution the extra xargs step is avoided.
– muru
Aug 10 at 14:34
1
1
You'll probably have to use the input as the format string, after replacing all
%
with %%
– muru
Aug 10 at 14:58
You'll probably have to use the input as the format string, after replacing all
%
with %%
– muru
Aug 10 at 14:58
1
1
@muru
printf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char string n
in $0 will remain as such even in the context of a printf format string. You could do gsub()
s but then you might run afoul of \n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.– Ed Morton
Aug 11 at 0:44
@muru
printf $0
wouldn't work because escape characters are expanded where the format string is defined, not where it's used, so the 2-char string n
in $0 will remain as such even in the context of a printf format string. You could do gsub()
s but then you might run afoul of \n
s. There simply is no equivalent functionality in awk and any workaround would be clunky at best.– Ed Morton
Aug 11 at 0:44
2
2
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
I just added said clunky workaround - unix.stackexchange.com/a/534944/133219.
– Ed Morton
Aug 11 at 1:16
|
show 1 more comment
You probably need to transform double-backslash to backslash as well, otherwise the input format would be ambiguous.
You can write a sed script to translate backslash-letter escapes. This script only translates the escape sequences that it recognizes and otherwise removes the backslash. I've put in support for newline and tab.
… | sed 's/\n/n/g; s/\t/ /; s/\(.)/1/g'
The whitespace in s/\t/ /
is a tab character. GNU sed lets you write s/\t/t/
.
If you also want octal escapes, use a more advanced tool such as Perl. You can make it parse all the escape sequences that it supports.
… | perl -pe 's/\([0-7]1,3|c.|[oxN][^]+|.)/""\$1""/eeg'
add a comment |
You probably need to transform double-backslash to backslash as well, otherwise the input format would be ambiguous.
You can write a sed script to translate backslash-letter escapes. This script only translates the escape sequences that it recognizes and otherwise removes the backslash. I've put in support for newline and tab.
… | sed 's/\n/n/g; s/\t/ /; s/\(.)/1/g'
The whitespace in s/\t/ /
is a tab character. GNU sed lets you write s/\t/t/
.
If you also want octal escapes, use a more advanced tool such as Perl. You can make it parse all the escape sequences that it supports.
… | perl -pe 's/\([0-7]1,3|c.|[oxN][^]+|.)/""\$1""/eeg'
add a comment |
You probably need to transform double-backslash to backslash as well, otherwise the input format would be ambiguous.
You can write a sed script to translate backslash-letter escapes. This script only translates the escape sequences that it recognizes and otherwise removes the backslash. I've put in support for newline and tab.
… | sed 's/\n/n/g; s/\t/ /; s/\(.)/1/g'
The whitespace in s/\t/ /
is a tab character. GNU sed lets you write s/\t/t/
.
If you also want octal escapes, use a more advanced tool such as Perl. You can make it parse all the escape sequences that it supports.
… | perl -pe 's/\([0-7]1,3|c.|[oxN][^]+|.)/""\$1""/eeg'
You probably need to transform double-backslash to backslash as well, otherwise the input format would be ambiguous.
You can write a sed script to translate backslash-letter escapes. This script only translates the escape sequences that it recognizes and otherwise removes the backslash. I've put in support for newline and tab.
… | sed 's/\n/n/g; s/\t/ /; s/\(.)/1/g'
The whitespace in s/\t/ /
is a tab character. GNU sed lets you write s/\t/t/
.
If you also want octal escapes, use a more advanced tool such as Perl. You can make it parse all the escape sequences that it supports.
… | perl -pe 's/\([0-7]1,3|c.|[oxN][^]+|.)/""\$1""/eeg'
answered Aug 10 at 15:09
GillesGilles
571k137 gold badges1178 silver badges1688 bronze badges
571k137 gold badges1178 silver badges1688 bronze badges
add a comment |
add a comment |
Here's what it'd take to do what you want with awk. Given this input:
$ printf '%sn' 'abc\ndefnghi'
abc\ndefnghi
Note that the first n
is itself escaped and so should be treated literally as \n
. Here's how to get the expected output:
$ printf '%sn' 'abc\ndefnghi' |
awk 'gsub(/@/,"@A"); gsub(/\\/,"@B"); gsub(/\n/,"n"); gsub(/@B/,"\\"); gsub(/@A/,"@")1'
abc\ndef
ghi
If you want other escape sequences interpreted too, e.g. t
, you'd add a separate gsub() for each of those right after the one for n
, e.g.:
awk '
gsub(/@/,"@A"); gsub(/\\/,"@B")
gsub(/\n/,"n")
gsub(/\t/,"t")
gsub(/@B/,"\\"); gsub(/@A/,"@")
1'
Those first 2 and last 2 gsub()s are creating a unique string @B
, mapping \
pairs to it to get them out of the way, and then mapping them back after the intended conversions are done.
add a comment |
Here's what it'd take to do what you want with awk. Given this input:
$ printf '%sn' 'abc\ndefnghi'
abc\ndefnghi
Note that the first n
is itself escaped and so should be treated literally as \n
. Here's how to get the expected output:
$ printf '%sn' 'abc\ndefnghi' |
awk 'gsub(/@/,"@A"); gsub(/\\/,"@B"); gsub(/\n/,"n"); gsub(/@B/,"\\"); gsub(/@A/,"@")1'
abc\ndef
ghi
If you want other escape sequences interpreted too, e.g. t
, you'd add a separate gsub() for each of those right after the one for n
, e.g.:
awk '
gsub(/@/,"@A"); gsub(/\\/,"@B")
gsub(/\n/,"n")
gsub(/\t/,"t")
gsub(/@B/,"\\"); gsub(/@A/,"@")
1'
Those first 2 and last 2 gsub()s are creating a unique string @B
, mapping \
pairs to it to get them out of the way, and then mapping them back after the intended conversions are done.
add a comment |
Here's what it'd take to do what you want with awk. Given this input:
$ printf '%sn' 'abc\ndefnghi'
abc\ndefnghi
Note that the first n
is itself escaped and so should be treated literally as \n
. Here's how to get the expected output:
$ printf '%sn' 'abc\ndefnghi' |
awk 'gsub(/@/,"@A"); gsub(/\\/,"@B"); gsub(/\n/,"n"); gsub(/@B/,"\\"); gsub(/@A/,"@")1'
abc\ndef
ghi
If you want other escape sequences interpreted too, e.g. t
, you'd add a separate gsub() for each of those right after the one for n
, e.g.:
awk '
gsub(/@/,"@A"); gsub(/\\/,"@B")
gsub(/\n/,"n")
gsub(/\t/,"t")
gsub(/@B/,"\\"); gsub(/@A/,"@")
1'
Those first 2 and last 2 gsub()s are creating a unique string @B
, mapping \
pairs to it to get them out of the way, and then mapping them back after the intended conversions are done.
Here's what it'd take to do what you want with awk. Given this input:
$ printf '%sn' 'abc\ndefnghi'
abc\ndefnghi
Note that the first n
is itself escaped and so should be treated literally as \n
. Here's how to get the expected output:
$ printf '%sn' 'abc\ndefnghi' |
awk 'gsub(/@/,"@A"); gsub(/\\/,"@B"); gsub(/\n/,"n"); gsub(/@B/,"\\"); gsub(/@A/,"@")1'
abc\ndef
ghi
If you want other escape sequences interpreted too, e.g. t
, you'd add a separate gsub() for each of those right after the one for n
, e.g.:
awk '
gsub(/@/,"@A"); gsub(/\\/,"@B")
gsub(/\n/,"n")
gsub(/\t/,"t")
gsub(/@B/,"\\"); gsub(/@A/,"@")
1'
Those first 2 and last 2 gsub()s are creating a unique string @B
, mapping \
pairs to it to get them out of the way, and then mapping them back after the intended conversions are done.
edited Aug 11 at 1:19
answered Aug 11 at 0:56
Ed MortonEd Morton
1,3104 silver badges9 bronze badges
1,3104 silver badges9 bronze badges
add a comment |
add a comment |
Easy enough: echo -e "tCLn1523 memon"
From man echo
:
-e enable interpretation of backslash escapes
add a comment |
Easy enough: echo -e "tCLn1523 memon"
From man echo
:
-e enable interpretation of backslash escapes
add a comment |
Easy enough: echo -e "tCLn1523 memon"
From man echo
:
-e enable interpretation of backslash escapes
Easy enough: echo -e "tCLn1523 memon"
From man echo
:
-e enable interpretation of backslash escapes
answered Aug 11 at 3:33
markgrafmarkgraf
3777 bronze badges
3777 bronze badges
add a comment |
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%2f534881%2fshow-stdout-containing-n-with-line-breaks%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
That is because echo does only interpret sequences as n if you use the switch -e.
– Janka
Aug 10 at 14:15
1
@Janka: In this case OP actually wants
echo
to not interpret the newlines as they are usingecho
to simulate thecurl
output that needs to be interpreted.– Jesse_b
Aug 10 at 14:22