Man shot during attempted carjacking