The defiant 29-year-old left-hander was approaching his second hundred but was bowled by a sharp delivery from Pakistan pacer Mohammad Ali in the last over before tea on the third day.
Veteran batter Mushfiqur Rahim was 15 not out as Bangladesh trail Pakistan's total of 448-6 declared by 249 runs with six wickets in hand.
Shadman added 52 runs for the fourth wicket with Rahim following his stubborn 94-run stand with Mominul Haque (50) in an earlier wicket stand.
Shadman hit 12 boundaries in his fighting five hour 29-minute stay at the crease.
Haque was the only batter dismissed in the post-lunch session when he missed a delivery from Khurram Shahzad and was bowled. He hit five boundaries in his 76-ball innings.
It was Shadman who anchored his team's fight as Pakistan's pace attack looked less effective on a Rawalpindi stadium pitch that has slowed down considerably.
Shahzad was the pick of home bowlers with 2-36 while Naseem Shah and Ali have a wicket each.
Shadman pulled pacer Shah's last delivery before the lunch interval for his sixth boundary to reach a third Test half-century as Bangladesh reached 134-2.
The Shadman-Haque stand led the recovery after Pakistan removed Zakir Hasan (12) and skipper Najmul Hossain Shanto (16) in the extended three-hour session due to Friday prayers.
Pakistan employed all four pacers but were missing the services of a frontline spinner.
Part-time slow bowler Agha Salman had Shadman leg-before wicket on 57 but the decision was overturned on review.
Resuming at 27-0, Bangladesh lost Zakir to a smart catch by wicketkeeper Mohammad Rizwan, diving to his left to take a one-handed catch in Shah's fifth over of the day.
Shanto looked good during his short knock but was bowled between bat and pad by Shahzad, leaving the visitors on 53-2.