Can I pipe stdout to the middle of a command?Pass the output of previous command to next as an argumentUsing...
What was the definition of "set" that resulted in Russell's Paradox
Confirming the Identity of a (Friendly) Reviewer After the Reviews
How to tell someone I'd like to become friends without letting them think I'm romantically interested in them?
Misspelling my name on my mathematical publications
Received a dinner invitation through my employer's email, is it ok to attend?
Was I subtly told to resign?
What is a solution?
Should disabled buttons give feedback when clicked?
How to md5 a list of filepaths contained in a file?
Has anyone in space seen or photographed a simple laser pointer from Earth?
During copyediting, journal disagrees about spelling of paper's main topic
Single word for "refusing to move to next activity unless present one is completed."
Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?
US Civil War story: man hanged from a bridge
How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?
How did the hit man miss?
Why are they 'nude photos'?
How to loop for 3 times in bash script when docker push fails?
What is the job of the acoustic cavities inside the main combustion chamber?
If a non-friend comes across my Steam Wishlist, how easily can he gift me one of the games?
Why was hardware diversification an asset for the IBM PC ecosystem?
Using Newton's shell theorem to accelerate a spaceship
Cops: The Hidden OEIS Substring
Managing and organizing the massively increased number of classes after switching to SOLID?
Can I pipe stdout to the middle of a command?
Pass the output of previous command to next as an argumentUsing data read from a pipe instead than from a file in command optionsHow to send stderr to stdout with a pipe to another command?How can I pipe stdout to another program?Pipe stdout to command on stdoutless command with pipeHow to invoke vim editor and pipe output to bashHow to read from a pipe keeping positional parameters?How can I time a pipe?Using pipe STDOUT as a variable?Script - Write stdout and stderr to a file AND to the terminal without pipe
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
The command
emacs -nw foo -f org-mode
opens the file foo
in emacs
in org-mode
.
Now, suppose that the filename foo
is the output of a script. How could I pipe to my command?
So, I'm trying to get something like
echo foo | emacs -nw {GET OUTPUT HERE} -f org-mode
to work. Is this possible?
pipe arguments stdout
add a comment |
The command
emacs -nw foo -f org-mode
opens the file foo
in emacs
in org-mode
.
Now, suppose that the filename foo
is the output of a script. How could I pipe to my command?
So, I'm trying to get something like
echo foo | emacs -nw {GET OUTPUT HERE} -f org-mode
to work. Is this possible?
pipe arguments stdout
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago
add a comment |
The command
emacs -nw foo -f org-mode
opens the file foo
in emacs
in org-mode
.
Now, suppose that the filename foo
is the output of a script. How could I pipe to my command?
So, I'm trying to get something like
echo foo | emacs -nw {GET OUTPUT HERE} -f org-mode
to work. Is this possible?
pipe arguments stdout
The command
emacs -nw foo -f org-mode
opens the file foo
in emacs
in org-mode
.
Now, suppose that the filename foo
is the output of a script. How could I pipe to my command?
So, I'm trying to get something like
echo foo | emacs -nw {GET OUTPUT HERE} -f org-mode
to work. Is this possible?
pipe arguments stdout
pipe arguments stdout
asked 17 mins ago
Brian FitzpatrickBrian Fitzpatrick
9722 gold badges11 silver badges23 bronze badges
9722 gold badges11 silver badges23 bronze badges
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago
add a comment |
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago
add a comment |
1 Answer
1
active
oldest
votes
How about simply using a subshell (as suggested in the comments):
emacs -nw $(<COMMAND GOES HERE>) -f org-mode
For example
emacs -nw $(echo foo) -f org-mode
Will open "foo" in org-mode
New contributor
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins 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%2f529473%2fcan-i-pipe-stdout-to-the-middle-of-a-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
How about simply using a subshell (as suggested in the comments):
emacs -nw $(<COMMAND GOES HERE>) -f org-mode
For example
emacs -nw $(echo foo) -f org-mode
Will open "foo" in org-mode
New contributor
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins ago
add a comment |
How about simply using a subshell (as suggested in the comments):
emacs -nw $(<COMMAND GOES HERE>) -f org-mode
For example
emacs -nw $(echo foo) -f org-mode
Will open "foo" in org-mode
New contributor
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins ago
add a comment |
How about simply using a subshell (as suggested in the comments):
emacs -nw $(<COMMAND GOES HERE>) -f org-mode
For example
emacs -nw $(echo foo) -f org-mode
Will open "foo" in org-mode
New contributor
How about simply using a subshell (as suggested in the comments):
emacs -nw $(<COMMAND GOES HERE>) -f org-mode
For example
emacs -nw $(echo foo) -f org-mode
Will open "foo" in org-mode
New contributor
New contributor
answered 4 mins ago
alnxalnx
413 bronze badges
413 bronze badges
New contributor
New contributor
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins ago
add a comment |
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins ago
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins ago
This would require that I already know the command. It would be nice to be able to pipe in from an arbitrary command with the same line of code.
– Brian Fitzpatrick
2 mins 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%2f529473%2fcan-i-pipe-stdout-to-the-middle-of-a-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
Possible duplicate of Pass the output of previous command to next as an argument
– muru
13 mins ago
@muru I read the question and answer you've referenced and don't understand how it helps me with my question.
– Brian Fitzpatrick
9 mins ago