how to write a script which can run simulations successively

Hello everyone, could you please tell me how to write the script to run a simulation successively with the last output structure file of the former simulation?