Answered Questions

  • Shell Scripting Commands

    In shell scripting How to indentify that the previous command was run successfully?

    Yogesh

    • Oct 4th, 2017

    Echo $?
    if answer 0 then last command was successful.
    if answer is any numeric value then last command is not successful.

    abdas

    • Jun 26th, 2011

    in 2 ways it can be done:1st way$ echo $?  2nd way:$ pwd 2> error| cat error|wc -l       0$ cat h 2> error| cat error|wc -l       1pwd or cat or any command if outpt is 0 then successful else failed.