I canβt shut my brain around why one of these functions works normally [status-up], but the other just hangs without output at all. [Status-REC]
Both pidfile and recfile are valid paths to their respective PID files in /var/run/ , and both contain only the PID number without line breaks or other non-printing characters.
status-up() { if [ -f ${pidfile} ]; then if ps p $(cat ${pidfile}) >> /dev/null; then printf "Upload running as PID %s\n" $(cat ${pidfile}) return fi fi echo "Upload is not running" } status-rec() { if [ -f ${recfile} ]; then if ps p $(cat ${recfile}) >> /dev/null; then printf "Receive running as PID %s\n" $(cat ${recfile}) return fi fi echo "Receive is not running" }
source share