How to output return code in shell?

前端 未结 3 853
孤街浪徒
孤街浪徒 2021-02-05 02:50

I\'m trying to call a custom shell script through sh:

/bin/sh -c \'myscript.sh` >log.txt 2>&1 & echo $!

Output of th

3条回答
  •  一向
    一向 (楼主)
    2021-02-05 03:26

    (
    /bin/sh -c 'myscript.sh` >log.txt 2>&1
    echo $? > some_file
    ) &
    

提交回复
热议问题