2 Replies Latest reply on Jun 11, 2014 6:16 AM by Monoj Padhy

    checking if command execution successful

    Monoj Padhy

      Hi,

       

      I am trying to check if command execution is successful and accordingly we need to perform some activity.

       

      nexec -i -e service rsyslog restart

       

      if $? -ne 0

      echo "failed to restart the service"

      exit 1

      fi

      echo "service restarted successfully"

       

      I am getting below error nsh:line_no command not found:1

      Any suggestion where I am getting wrong here.

       

      Regards,

      Blas