1

I actually wrote a script that is compiling my LaTeX files and open the generated PDF in a viewer. That works fine.

cd Documents/my-bachelor-thesis/
latexmk 000_Root_Bachelor_Thesis.tex -pdf
open 000_Root_Bachelor_Thesis.pdf

ps -A | grep -m1 vorschau | awk '{print $1}'

So with the last line I get the PID of the process my PDF is opened.

There is the problem: I want stop my script process at the point the PDF is open. After I click on the close sign of the viewer, the process should continuo automatically. Is that somehow possible.

Current solution: I interrupt the process while waiting for some user input. After i type in something the process goes on.

echo "Can I proceed?"
    read input

... more script

Thanks for helping me out.

1 Answer 1

2

Not familar with open in OSX. Quick search on man page suggests that you can force open to start new application, and wait until it finish by

open -Wn 000_Root_Bachelor_Thesis.pdf

Options:

-W Wait until the applications exit (even if they were already open). Use with the -n flag to allow open to function as an appropriate app for the $EDITOR environment variable.

-n Open a new instance of the application(s) even if one is already running.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.