Search code examples
bashcut

using cut on a result of running another bash script


I want to run script score with "A" and "B" parameters and apply cut on the result. In the following way:

targetTeamOffence=`sh ./score.sh A B | cut d" " -f2`

However I'm getting wrong usage of cut error.

What I doing wrong?


Solution

  • You're missing a - with -d:

    targetTeamOffence=`sh ./score.sh A B | cut -d" " -f2`