Why not just write a bash script to do this, run that script, and done?