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.

  • Database Connecion

    How will you write a shell script to connect to SQL database?

    Ashutosh Gupta

    • Sep 10th, 2011

    In vi editor
    vi connect.sh
    #!/bin/bash

    sqlplus -s sys as sysdba

    NARESH

    • Jul 31st, 2011

    Sqlplus -s username/password@schema name
    :wq