If you run this code in a controller action (notice the backticks)
def index
…
`pwd >> tc.log`
`git status >> tc.log`
`ls >> tc.log`
…
end
, only the 1st and 3rd command will pipe their output to the tc.log file.
I'm trying to get the output of git status
(f.ex) in a controller action and have tried many variations (capturing stdout, piping to a file, open3, ..) to no avail.
Any idea?