add function to record the return value of shellscript