Use subprocess instead of sh