c - How can I wait until specified "xterm" finished? -


in c-shell file, did like:

xterm -e "source xxxx0" &

xterm -e "source xxxx1" &

wait

code....

it works fine code after "wait" executed after 2 xterm finished.

but gives problem. if have ps open, txt file opened geditn, or have eclipse open, hung there since "wait" waiting jobs finished.

so how can let "wait" wait 2 xterm jobs.

or in word, want 2 "xterm" run concurrently. , after both done, code can continued. how shall that?

thank much

tell wait process ids should wait for:

xterm ... & pid1=$!  xterm ... & pid2=$!  wait $pid1 $pid2 

that's assuming use shell wait supports multiple arguments (bash,zsh, ...). if use sh portability, have 2 waits:

wait $pid1 wait $pid2 

this wait untill both finished. if second finishes before first, wait return.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -