Linux run script replaced by C code