Sample Header Ad - 728x90

SQL*Plus version not printing in tempfile

1 vote
1 answer
95 views
I am trying to execute below Unix script to fetch the Oracle version from Windows command prompt using ssh command to connect to Unix terminal.
#!/use/bin/ksh
Freport=/tmp/test.txt
cd /usr/oracle2/product/11.2.0/bin
echo "Begin" > $Freport
set +x
/usr/oracle2/product/11.2.0/bin/sqlplus -V >> $Freport
set -x
pwd >> $Freport
echo "Completed" >> $Freport
Windows command prompt output:
Begin
/usr/oracle2/product/11.2.0/bin
Completed
Same script ran in Unix server and got below output. Putty output:
Begin

SQL*Plus: Release 11.2.0.1.0

/usr/oracle2/product/11.2.0/bin
Completed
I want to print the Oracle version in my Windows command prompt output. Windows command prompt execution:
C:\programfiles\PUTTY>putty.exe -ssh uname@ip -pw pwd -m windowsscriptpath/test.sh
Any idea how I can solve this?
Asked by Chakkara (37 rep)
Feb 14, 2023, 12:57 PM
Last activity: Feb 17, 2023, 10:05 AM