I'm trying to write a workflow, which would clean a C/C++ file, via astyle command line program, using clipboard copy and paste.
It has to be the simplest workflow, yet I cannot make it preserve new lines.
What is the best way to output something into stdin and read from there?
So far I'm trying this in a bash script (with argv) but it removes all the new lines characters:
echo -n $1 | /usr/local/bin/astyle
https://www.dropbox.com/s/bkffs7j6nchwbog/astyle clean.alfredworkflow?dl=0