This is the mail archive of the
mailing list for the Cygwin project.
Piping output from sqlplus
- From: Chuck <skilover at softhome dot net>
- To: cygwin at cygwin dot com
- Date: Thu, 16 Dec 2004 15:29:16 -0500
- Subject: Piping output from sqlplus
-----BEGIN PGP SIGNED MESSAGE-----
I'm having a strange problem reading the output from sqlplus in Cygwin.
Sqlplus is a windows command line program used to access oracle
databases. My command looks something like this...
sqlplus -s <<! | read line
set pagesize 0 linesize 200 feedback off tab off
This should output one line to stdout with the two values separated by a
tab character. The read command should read it into the variable $line.
On my Solaris system it works perfectly. In Cygwin, $line is empty.
If I remove the "read line", the output displays on the tty just fine.
I though it might be related to the line end characters so I tried
converting them with the dos2unix filter. Didn't work. Neither did tr -d
\\r. Both ways, $line still ends up being empty.
If I replace the "read line" with "od -c" to dump the characters, it
shows the one line as expected.
If I redirect the output to a file, the file contains one line as expected.
If I try to read the output into a variable, I get an empty variable
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html