Skip to main content
added 50 characters in body
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

Since you are redirecting the output form the command into a file, there is no ouput to put into the variable.

You may use the tee utility to fix this:

STATUS=$( sqlplus ... <<EOF | tee -a logfile
...
EOF
)

tee will duplicate its input to all the named files, as well as to its own standard output (which will be inserted into you variable).

Also, please double quote the password as "$PASSWD" or you will have all sorts of issues if the password contains special characters. The same goes for "$STATUS" when you echo it.

Since you are redirecting the output form the command into a file, there is no ouput to put into the variable.

You may use the tee utility to fix this:

STATUS=$( sqlplus ... <<EOF | tee -a logfile
...
EOF
)

Also, please double quote the password as "$PASSWD" or you will have all sorts of issues if the password contains special characters.

Since you are redirecting the output form the command into a file, there is no ouput to put into the variable.

You may use the tee utility to fix this:

STATUS=$( sqlplus ... <<EOF | tee -a logfile
...
EOF
)

tee will duplicate its input to all the named files, as well as to its own standard output (which will be inserted into you variable).

Also, please double quote the password as "$PASSWD" or you will have all sorts of issues if the password contains special characters. The same goes for "$STATUS" when you echo it.

Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

Since you are redirecting the output form the command into a file, there is no ouput to put into the variable.

You may use the tee utility to fix this:

STATUS=$( sqlplus ... <<EOF | tee -a logfile
...
EOF
)

Also, please double quote the password as "$PASSWD" or you will have all sorts of issues if the password contains special characters.