Linux – Use output from command line as a parameter for a command

bashcommand linelinux

Possible Duplicate:
How to replace a command with the result of another in linux?

I'm able to parse my command output so it only shows the file name that I'm interested.

My question is, I want to be able to take the output and use it as a parameter for svn diff.

svn diff /filename_from_output/

Best Answer

  • Normally, the following should work:

    svn diff "$(your-command)"
    

    $() is simple bash command substitution. The output of the command enclosed in $() will be substituted in the outer command.

  • Related Question