You can transfer NBT data from one entity to another in newer versions of minecraft. To replace all eggs with arrows with the same
Motion-tag, you could use these three commands, executed in a repeating command block and then two chain command blocks:
/execute at @e[type=egg] run summon minecraft:arrow ~ ~ ~
/execute as @e[type=minecraft:arrow] at @s run data modify entity @s Motion set from entity @e[type=egg,distance=0,limit=1] Motion
The first command summons an arrow at the position of every egg.
The second command sets the
Motion-tag of every arrow to the same value as any egg that is in exactly the same position.
The third command kills all eggs.