Forever (a process manager for nodejs) gives new random logs each time you restart it.
I'm able to get the log filename with this command:
$ forever list | grep coffee | awk '{print $8}'
/home/vagrant/.forever/ZZRW.log
I'd like to be able to pass this filename into a vim command, so vim ends up executing:
vim /home/vagrant/.forever/ZZRW.log
And I'd like to alias this in my .bash_profile to be something like:
alias vimforeverlog="vim ???? forever list | grep coffee | awk '{print $8}'"
Any ideas? I feel like I'm just missing a basic feature of pipes.
vim $(forever list | grep coffee | awk '{print $8}')
should do the job, same as opening result from find in vim.
forever list | grep coffee | awk '{print $8}' | xargs vim
xargs takes the output of the last command and appends it to the command line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With