generalised run_sq0.sh script