I don't think you need the sort | uniq because grep will only print each file name once. In any event, the purpose of cat is to concatenate multiple files, so you really don't need the loop either.
Hi All
This may not be entirely Unix related but I'll just have to try my luck and see if you know how to do this:
I need to spool the results of my SQL query into a file but as there are too many fields in the query the resultant spool file put the last few fields on the next line.
May I... (2 Replies)
hi,
can anyone help me by saying how can i spool a unix file.. do we need to specify the pathname as such to spool the file ..
right now, i tried giving like spool filename in the sql prompt.. but its not giving me the required output even if i can see that the command is being executed..
... (2 Replies)
HI
Have some problem with spooling out some relatively large number of records (~2-3 mil)
Small table - OK though.
Getting error: SP2 0308: cannot close spool file.
Any thoughts?
sqlplus -s user/pwd << EOF
set term off
set head off
set trims on
set pages 0
set... (1 Reply)
Dear Gurus,
Tried searching for some clues in this forum but dont seem to be able to find my answer. :confused:
Anyway i have a quick question:
Today I have produced a messages generated from a application and placed them on the print queue. Before this I had stopped the printer queue, so... (2 Replies)
Hi,
Iam a newbie. When I give the below query at SQL prompt.
SQL> select col1||'`ß`'||col2 from tablename where rownum<2;
1-J7WGX`ß`1-7OKC-23
Iam getting ß within appostropies...... If I remove appostropies and give the query it is throwing an error.
If I give the same query in spool as... (1 Reply)
hi all,
am trying to write a ksh script which will take a username, password, db instance as input arguments and login to the database using sqlplus and select some data via sql and spool to a file.
problem is that i am using "sqlplus -s" in order to hide the username/password and it doesnt... (8 Replies)
Hi
I am logging into sql using script.
sqlplus ima/ima@test <<!
spool /opt/tt/spoolfile.txt
@sql.sql
spool off.
now i am getting a spool file named spoolfile.txt.lst
i want it to be only spoolfile.txt
I am working on solaris
Please help (6 Replies)
Hello,
I am trying to spool data from database into a file on solaris through ksh.
Data is getting fetched but the problem is record is getting split in to multiple lines.
excerpt from sql is
whenever sqlerror exit 1;
set define on
set echo off
set feed off
set head off
set... (1 Reply)
Hi,
I have a requirement of
Connecting to sqlplus from unix
Execute the package. The output of package is stored in a table
Need to query the table and move to txt file.
The problem iam facing is, when I try to spool the file. I get the sql query also along with the output.... (6 Replies)
Hello,
I have a shell script through which I am executing .sql file and spooling the result of Query from .sql . I want to spool the result in ascending order. Is there any parameter to be set to print result in ascending or descending order.
Thanks in advance. (4 Replies)
Discussion started by: Aparna.N
4 Replies
LEARN ABOUT SUSE
unbuffer
UNBUFFER(1) General Commands Manual UNBUFFER(1)NAME
unbuffer - unbuffer output
SYNOPSIS
unbuffer program [ args ]
INTRODUCTION
unbuffer disables the output buffering that occurs when program output is redirected from non-interactive programs. For example, suppose
you are watching the output from a fifo by running it through od and then more.
od -c /tmp/fifo | more
You will not see anything until a full page of output has been produced.
You can disable this automatic buffering as follows:
unbuffer od -c /tmp/fifo | more
Normally, unbuffer does not read from stdin. This simplifies use of unbuffer in some situations. To use unbuffer in a pipeline, use the
-p flag. Example:
process1 | unbuffer -p process2 | process3
CAVEATS
unbuffer -p may appear to work incorrectly if a process feeding input to unbuffer exits. Consider:
process1 | unbuffer -p process2 | process3
If process1 exits, process2 may not yet have finished. It is impossible for unbuffer to know long to wait for process2 and process2 may
not ever finish, for example, if it is a filter. For expediency, unbuffer simply exits when it encounters an EOF from either its input or
process2.
In order to have a version of unbuffer that worked in all situations, an oracle would be necessary. If you want an application-specific
solution, workarounds or hand-coded Expect may be more suitable. For example, the following example shows how to allow grep to finish pro-
cessing when the cat before it finishes first. Using cat to feed grep would never require unbuffer in real life. It is merely a place-
holder for some imaginary process that may or may not finish. Similarly, the final cat at the end of the pipeline is also a placeholder
for another process.
$ cat /tmp/abcdef.log | grep abc | cat
abcdef
xxxabc defxxx
$ cat /tmp/abcdef.log | unbuffer grep abc | cat
$ (cat /tmp/abcdef.log ; sleep 1) | unbuffer grep abc | cat
abcdef
xxxabc defxxx
$
BUGS
The man page is longer than the program.
SEE ALSO
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995.
AUTHOR
Don Libes, National Institute of Standards and Technology
1 June 1994 UNBUFFER(1)