#!/bin/bash echo executing the robot browser "/cygdrive/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" --profile-directory="Profile 1" while [[ ! $(ls input/PrmProductAllView.AddViewItem* 2>/dev/null) ]] do echo waiting for robot browser to finish by polling existence of last file created. sleep 30 done echo robot browser finished, converting and adding to output. ./process.sh echo killing the browser window. taskkill /FI "WINDOWTITLE eq Riverbed SteelCentral Appinternals - Google Chrome"