How were they shafted? They worked and they got paid.
Example: Shutdown continues until February. The essential group had to report for duty but the non-essential did not. Neither group is receiving a paycheck during this time frame. Pay is not received until the shutdown is settled and congress agrees to give back pay (which is no guarantee). Historically, everyone gets paid.