bash - How to run sctipt b based on script a result -


i've got 2 working sctipts: a.sh, b.sh.

i create 1 script following: 1. run a.sh 2. running b.sh dependant on output of a.sh wait string a.sh standatd output saying 'a.sh launched' run b.sh if trickyto implement perhaps wait 2 minutes before running second script.

what best way acheiving this?

continuously reads output of a.sh , when encounters "a.sh launched" launches b.sh.

./a.sh | while read line;     echo $line      # if want see output of a.sh     [ "$line" == "a.sh launched" ] && ./b.sh & done 

if want match

a.sh lounched @ `date` 

use advanced bash comparsion

[[ "$line" =~ "a.sh lounched".* ]] 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -