0

Say I write a bash script to do this

#!/bin/bash
vulcan build -v -s .-c "./configure --enable-static etc.. etc..

The output of this command includes

->> Downloading build artifacts to
(available at http://myapp.herokuapp.com/{guid}

How would I parse this response that displays on the terminal to capture this url?

MikeW
  • 4,749
  • 9
  • 42
  • 83

1 Answers1

0
var="->> Downloading build artifacts to
(available at http://myapp.herokuapp.com/{guid}" 

echo ${var#*available at }

Output:

http://myapp.herokuapp.com/{guid}

To capture output of the command into variable var:

var=$(vulcan build -v -s .-c "./configure --enable-static etc.. etc..)

Which is basically:

var=$(yourcommand)

See here and here for more info about Parameter Expansion and Command Substitution.

a5hk
  • 7,532
  • 3
  • 26
  • 40