Can you banish a unit from your trash with a shadow clone if the battlefield is empty?
No. "When I attack" only triggers when a unit gains the Attacker designation during Combat — moving a Shadow Clone to an empty battlefield stages a Non-Combat Showdown, and no Attacker designation is ever granted there, so the trigger never fires and you can't banish.
The banish-from-trash itself is perfectly legal as an effect (banishing from the trash is allowed — Rule 427, FAQ #9081); the issue is purely that the trigger condition isn't met.
If the battlefield is occupied by an enemy unit (a real Combat Showdown), the Shadow Clone does gain the Attacker designation and its trigger fires, letting you banish a unit from your trash and give it Assault 4. Per Rule 383.4.e and FAQ #8664.