Saving storage

I want to place down a shulker box with a command, then when the player puts stuff inside and walks away, it deletes the shulker box and saves the items, the next time the shulker box is put down it has the items again, kinda like an ender chest.

Is there any way to do that with commands?

Continue to help post