Sanchez had fallen out of favor with the Marlins this season, hitting .202/.250/.306 in just under 200 plate appearances. Sanchez did it 19 home runs in 2010 and 2011.
Hernandez has a .281/.343/.377 career batting line.
Sanchez could prove to be a perfect fit for the Pirates, who have been looking to add more offense to their lineup.
The Pirates are playing winning baseball for the first time in 19 seasons.
Meanwhile, the Marlins have gone a completely different direction than the Pirates, having traded Anibal Sanchez and Omar Infante to the Tigers, and Hanley Ramirez and Randy Choate to the Dodgers earlier.