How to explort content from file into variable? [duplicate]
up vote
0
down vote
favorite
This question already has an answer here:
How do I assign the output of a command to a variable?
1 answer
I need save into variable the file content (json string).
I try several methods, in particular:
#!/bin/bash
myjson=cat patch/file.jsn
but nothing not work.
How to correctly implement this task?
bash environment-variables
marked as duplicate by muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 17 at 9:42
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
How do I assign the output of a command to a variable?
1 answer
I need save into variable the file content (json string).
I try several methods, in particular:
#!/bin/bash
myjson=cat patch/file.jsn
but nothing not work.
How to correctly implement this task?
bash environment-variables
marked as duplicate by muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 17 at 9:42
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
How do I assign the output of a command to a variable?
1 answer
I need save into variable the file content (json string).
I try several methods, in particular:
#!/bin/bash
myjson=cat patch/file.jsn
but nothing not work.
How to correctly implement this task?
bash environment-variables
This question already has an answer here:
How do I assign the output of a command to a variable?
1 answer
I need save into variable the file content (json string).
I try several methods, in particular:
#!/bin/bash
myjson=cat patch/file.jsn
but nothing not work.
How to correctly implement this task?
This question already has an answer here:
How do I assign the output of a command to a variable?
1 answer
bash environment-variables
bash environment-variables
asked Nov 17 at 9:34
Valentyn Hruzytskyi
2009
2009
marked as duplicate by muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 17 at 9:42
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 17 at 9:42
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38
add a comment |
1
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38
1
1
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
You can try this:
#!/bin/bash
myjson=$(cat patch/file.jsn)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can try this:
#!/bin/bash
myjson=$(cat patch/file.jsn)
add a comment |
up vote
1
down vote
You can try this:
#!/bin/bash
myjson=$(cat patch/file.jsn)
add a comment |
up vote
1
down vote
up vote
1
down vote
You can try this:
#!/bin/bash
myjson=$(cat patch/file.jsn)
You can try this:
#!/bin/bash
myjson=$(cat patch/file.jsn)
answered Nov 17 at 9:39
kukulo
1,235417
1,235417
add a comment |
add a comment |
1
mjson=`cat patch/file.jsn` (backticks cause the command's output to replace the command)
– guiverc
Nov 17 at 9:38