Shirk was born in Pennsylvania and was appointed midshipman on 26 March 1849. He cruised between 1849 and 1860 on the coasts of Africa, East India, and North America, in the gunnery ship, Plymouth. He also served in the Great Lakes and with the Pacific Squadron. During the Civil War, he won distinction for his service in the Mississippi Squadron at the Battle of Fort Henry on 6 February 1862; and at Pittsburgh Landing on 1 March 1862; and again on 6 and 7 April 1862. During the latter engagement at Pittsburgh Landing, his ship, Lexington, in company with Tyler, prevented the enemy from crossing the river and saved the Union army from defeat in the bloody Battle of Shiloh. He later took part in engagements with Confederate batteries at Chickasaw Bayou, St. Charles, White River, Arkansas Post, and the passage of the Vicksburg batteries. During the siege of Vicksburg, his ship, Tuscumbia, was frequently under fire between 19 May and the Confederate surrender on 4 July 1863.
He commanded the Seventh Division of the Mississippi Squadron in 1863 and 1864. After peace had been restored, he cruised in the European Squadron and performed special duty for the Navy Department from 1866 to 1872.
Commander Shirk died in Washington, D.C., on 10 February 1873.
USS Shirk (DD-318) was named for him.