问题
Is there an easy way to pipe content to the editor atom?
For example:
echo "Content." | atom
Unfortunately atom does not get the content. The current version of gedit has the parameter -
to enable reading of STDIN:
echo "Content." | gedit -
I could not find a similar option in the atom-help (atom -h
)
回答1:
Thank you for asking about this! I just now bumped into the same issue.
Is there an easy way to pipe content to the editor atom?
The current atom
command-line interface (CLI) will not open content piped to its standard input (stdin
).
There's a Pull Request open to add this functionality. The proposed solution writes contents from stdin
to a file in /tmp
, then opens that file in Atom.
For now, if you're open to hacking the atom
CLI, you could manually apply the changes proposed there.
来源:https://stackoverflow.com/questions/33237732/how-to-enable-atom-io-to-read-stdin