How to print variable value in next line using echo commandHow to use “quickly run” and pass command-line arguments?Problem in unmounting a disk image with a script… but not manually!Mysterious behavior of echo commandecho #? is not printing any kind of valueEscape command in echoecho command variationsecho command echo the blank output instead of Variable value in Ubuntu 18.04
Is the decimation process time invariant?
What terminologies are used when an ATC instruct a pilot to stop or proceed his transmission?
Use of the common English abbreviation for German term
Mostly One Way Travel : Says Grandpa
What is the difference between scissors and shears?
Is gaining 1 AC in exchange for disadvantage on Perception checks a balanced trade?
Why are green parties so often opposed to nuclear power?
Wrong cell width in table while merging colums
Arcane Adept: is this proposed Warlock feat balanced as compared to PHB feats?
Why is the processor instruction called "move", not "copy"?
Can I make leading exclamation points be ignored in the terminal? (I type them by instinct due to ipython)
I wasted the 6 years of my life and I don't know what should I do and how will I survive?
Why couldn't Rick just use a micro sun to power his car?
If a picture of a screen is a screenshot, what is a video of a screen?
Why try to impeach Trump now?
Does it make sense to use strict equality constraint in optimization?
Unpaid suspension due to management error
Can a creature of any alignment attune to this magic weapon in Curse of Strahd?
What should I do about a new employee who didn't mention their second job or planned leave?
Relationship between Color Index and Temperature
How many atoms in the hydrocarbon?
Why isn't current carried through a vacuum?
What should be done when the theory behind a PhD thesis turns out to be wrong?
Intersection of sorted lists
How to print variable value in next line using echo command
How to use “quickly run” and pass command-line arguments?Problem in unmounting a disk image with a script… but not manually!Mysterious behavior of echo commandecho #? is not printing any kind of valueEscape command in echoecho command variationsecho command echo the blank output instead of Variable value in Ubuntu 18.04
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm getting a curl command output as below
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at'
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
and I'm storing it in a variable and trying to pass echo the variable
to pass the value to another command to parse the output. But when I'm trying to echo the variable it is printing all the lines as a single line.
prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
echo $prlist
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
How to avoid this printing in different line? Please help.
command-line bash printing echo
add a comment
|
I'm getting a curl command output as below
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at'
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
and I'm storing it in a variable and trying to pass echo the variable
to pass the value to another command to parse the output. But when I'm trying to echo the variable it is printing all the lines as a single line.
prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
echo $prlist
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
How to avoid this printing in different line? Please help.
command-line bash printing echo
1
Please edit your question and show us the exact commands you are using. We need to see thecurlcommand and theechocommand. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.
– terdon
Sep 28 at 12:47
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
Thank you, but as I said before, we need all commands, including theechoone. In fact, especially theecho. How are you saving thecurloutput in a variable? How are you then printing that variable? And what parsing are you trying to do?
– terdon
Sep 28 at 12:55
@dessert I have updated it
– harsha
Sep 28 at 12:58
add a comment
|
I'm getting a curl command output as below
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at'
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
and I'm storing it in a variable and trying to pass echo the variable
to pass the value to another command to parse the output. But when I'm trying to echo the variable it is printing all the lines as a single line.
prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
echo $prlist
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
How to avoid this printing in different line? Please help.
command-line bash printing echo
I'm getting a curl command output as below
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at'
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
and I'm storing it in a variable and trying to pass echo the variable
to pass the value to another command to parse the output. But when I'm trying to echo the variable it is printing all the lines as a single line.
prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
echo $prlist
5 test 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 test1 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 test2 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 test3 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z1 test4 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
How to avoid this printing in different line? Please help.
command-line bash printing echo
command-line bash printing echo
edited Sep 28 at 12:56
harsha
asked Sep 28 at 12:41
harshaharsha
18313 bronze badges
18313 bronze badges
1
Please edit your question and show us the exact commands you are using. We need to see thecurlcommand and theechocommand. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.
– terdon
Sep 28 at 12:47
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
Thank you, but as I said before, we need all commands, including theechoone. In fact, especially theecho. How are you saving thecurloutput in a variable? How are you then printing that variable? And what parsing are you trying to do?
– terdon
Sep 28 at 12:55
@dessert I have updated it
– harsha
Sep 28 at 12:58
add a comment
|
1
Please edit your question and show us the exact commands you are using. We need to see thecurlcommand and theechocommand. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.
– terdon
Sep 28 at 12:47
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
Thank you, but as I said before, we need all commands, including theechoone. In fact, especially theecho. How are you saving thecurloutput in a variable? How are you then printing that variable? And what parsing are you trying to do?
– terdon
Sep 28 at 12:55
@dessert I have updated it
– harsha
Sep 28 at 12:58
1
1
Please edit your question and show us the exact commands you are using. We need to see the
curl command and the echo command. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.– terdon
Sep 28 at 12:47
Please edit your question and show us the exact commands you are using. We need to see the
curl command and the echo command. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.– terdon
Sep 28 at 12:47
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
Thank you, but as I said before, we need all commands, including the
echo one. In fact, especially the echo. How are you saving the curl output in a variable? How are you then printing that variable? And what parsing are you trying to do?– terdon
Sep 28 at 12:55
Thank you, but as I said before, we need all commands, including the
echo one. In fact, especially the echo. How are you saving the curl output in a variable? How are you then printing that variable? And what parsing are you trying to do?– terdon
Sep 28 at 12:55
@dessert I have updated it
– harsha
Sep 28 at 12:58
@dessert I have updated it
– harsha
Sep 28 at 12:58
add a comment
|
1 Answer
1
active
oldest
votes
What you describe is the standard behavior of echoing an unquoted variable:
$ prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
$ echo $prlist
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z 1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
That's because $prlist is not quoted. Compare with what happens if you quote it:
$ echo "$prlist"
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
But why use a variable at all? You can just parse the output of curl directly:
curl ... | jq ... | someOtherCommand
Like this:
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+"
"+.user.login+" "+.created_at+" "+.merged_at'curl
-s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
someOtherCommand
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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/4.0/"u003ecc by-sa 4.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%2faskubuntu.com%2fquestions%2f1177279%2fhow-to-print-variable-value-in-next-line-using-echo-command%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
What you describe is the standard behavior of echoing an unquoted variable:
$ prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
$ echo $prlist
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z 1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
That's because $prlist is not quoted. Compare with what happens if you quote it:
$ echo "$prlist"
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
But why use a variable at all? You can just parse the output of curl directly:
curl ... | jq ... | someOtherCommand
Like this:
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+"
"+.user.login+" "+.created_at+" "+.merged_at'curl
-s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
someOtherCommand
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
add a comment
|
What you describe is the standard behavior of echoing an unquoted variable:
$ prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
$ echo $prlist
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z 1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
That's because $prlist is not quoted. Compare with what happens if you quote it:
$ echo "$prlist"
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
But why use a variable at all? You can just parse the output of curl directly:
curl ... | jq ... | someOtherCommand
Like this:
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+"
"+.user.login+" "+.created_at+" "+.merged_at'curl
-s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
someOtherCommand
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
add a comment
|
What you describe is the standard behavior of echoing an unquoted variable:
$ prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
$ echo $prlist
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z 1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
That's because $prlist is not quoted. Compare with what happens if you quote it:
$ echo "$prlist"
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
But why use a variable at all? You can just parse the output of curl directly:
curl ... | jq ... | someOtherCommand
Like this:
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+"
"+.user.login+" "+.created_at+" "+.merged_at'curl
-s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
someOtherCommand
What you describe is the standard behavior of echoing an unquoted variable:
$ prlist=$(curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "+.merged_at')
$ echo $prlist
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z 4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z 3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z 2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z 1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
That's because $prlist is not quoted. Compare with what happens if you quote it:
$ echo "$prlist"
5 SMYALTAMASH 2019-09-27T11:06:23Z 2019-09-27T11:09:28Z
4 ganesh-28 2019-09-26T16:56:40Z 2019-09-26T16:57:02Z
3 ganesh-28 2019-09-26T16:54:25Z 2019-09-26T16:54:55Z
2 ganesh-28 2019-09-26T16:52:59Z 2019-09-26T16:55:19Z
1 ganesh-28 2019-09-26T16:46:52Z 2019-09-26T16:47:25Z
But why use a variable at all? You can just parse the output of curl directly:
curl ... | jq ... | someOtherCommand
Like this:
curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
jq -r '.[]|(.number|tostring)+"
"+.user.login+" "+.created_at+" "+.merged_at'curl
-s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls?state=all |
someOtherCommand
edited Sep 28 at 13:03
answered Sep 28 at 12:58
terdonterdon
76.2k14 gold badges153 silver badges239 bronze badges
76.2k14 gold badges153 silver badges239 bronze badges
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
add a comment
|
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
1
1
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
Thanks @terdon, adding quotes worked.
– harsha
Sep 28 at 13:01
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
I'm storing it in a variable because I need to pass same output as input to multiple api's down the script. @terdon
– harsha
Sep 28 at 17:13
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1177279%2fhow-to-print-variable-value-in-next-line-using-echo-command%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
Please edit your question and show us the exact commands you are using. We need to see the
curlcommand and theechocommand. You're probably simply not quoting correctly, but you almost certainly don't need to echo at all. If you give us the full commands, we can give you a better solution.– terdon
Sep 28 at 12:47
@terdon I have updated the question with the curl command I'm using.
– harsha
Sep 28 at 12:52
Thank you, but as I said before, we need all commands, including the
echoone. In fact, especially theecho. How are you saving thecurloutput in a variable? How are you then printing that variable? And what parsing are you trying to do?– terdon
Sep 28 at 12:55
@dessert I have updated it
– harsha
Sep 28 at 12:58