BACKQUOTES

  • The (text) result of any command can be captured using backquotes: `

  • This is very useful for setting variables.

  • Examples:
    $ v=`ls sub[13]*`
    $ echo $v
      sub1_t1.nii.gz sub1_t2.nii.gz sub3_pd.nii.gz
    $ echo `fslval sub1_t1 pixdim2`
      4.0

  • NB: the result is always treated as a single string, even if it contains spaces