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?
EDIT: This question has been voted to close, but the answer referenced doesn't work and wasn't tested by the user who voted to close.
echo foo | xargs -I {} emacs -nw {} -f org-mode
, or as alnx suggested,emacs -nw "$(echo foo)" -f org-mode
.echo foo | xargs -I {} emacs -nw {} -f org-mode
returns an error for me. Does it work on your machine?