Fixes #725: Inventory file name never change

I also changed the command here a little - we needed grep to get just the right line from the output of run-inventory. Also, I replaced two sed commands by one.