In fastlane file, I connect the script with the following command:

test = sh"./bash_script.sh" 

And the test output is written to the entire output of the script.

How do I get the value of the $ result variable in fastlane, and not the entire output?

  • output only the value of this variable. what's the problem? - aleksandr barakin
  • Suppress all output in the script except the one needed with> / dev / null 2> & 1 - Andrey

1 answer 1

1) Suppress all the output inside the script except for the required one using > /dev/null 2>&1
2) test="$(sh ./bash_script.sh | tail -1)" If the string with the result is displayed last