07-14-2005
if [ $( find /tmp/tst_file -mtime -1 grep | wc -l ) -eq 1 ]; then ...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
2 AIX servers (AIX 5.3). From local server, I need to manage remote files. But I have some errors with find :
# rsh remoteserver find /directory -name filename
is OK : I can see the remote file
BUT :
# rsh remoteserver find /directory -name filename -exec ls -l {} \;
fails : I have :
find :... (5 Replies)
Discussion started by: annemar
5 Replies
2. AIX
Hi,
While trying to configure Apache Web Server on P630 Server i am getting the below message
"Creating Makefile in src
+ configured for AIX 5.2 platform
Error: could not find any of these C compilers
anywhere in your PATH: gcc cc acc c89
Configure terminated"
when i did a "lslpp -l... (2 Replies)
Discussion started by: cherryven
2 Replies
3. Shell Programming and Scripting
I have a directory that our applications are continuely generate new file to it , some files hv a word "error" in content , I would like to find out which file hv this word and send me notify mail to inform me which file hv this word , currently , I have a stupid script to grep the word , the... (1 Reply)
Discussion started by: ust
1 Replies
4. Shell Programming and Scripting
Hi Guru's
here is part of my shell script where the error is coming.
function daemon_start
{
daemon=""
clear
:<<COMMENT
Meenakshi 25-Jun Code Cleanup IA - code comented - Start
echo "
`date`
... (1 Reply)
Discussion started by: namishtiwari
1 Replies
5. UNIX for Advanced & Expert Users
for FNAME in `find . -type f -exec grep -il unixs317 {} \;`; do C=`grep -c unixs317 ${FNAME}`; echo "${C}:${FNAME}" >> output.txt; done
When I run this command and a directory is empty it is returning an error and just does nothing more.
How can I continue with my search even when it find... (3 Replies)
Discussion started by: TimHortons
3 Replies
6. UNIX for Dummies Questions & Answers
Have a random question:
In simple terms I have a find command on a dir:
/path/user/data/
/path/user is a link to:
/tmp/storage/
The find command outputs the files it finds as:
/path/user/data/file
What I need is:
/tmp/storage/file
Is there a way to "resolve" the Unix... (5 Replies)
Discussion started by: Cranie
5 Replies
7. Programming
Please see the error below
Program:
#include<stdio.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<unistd.h>
#include<signal.h>
#include<string.h>
main(int argc, char *argv)
{
int fd,changes,i,random_spot,kids;... (1 Reply)
Discussion started by: gokult
1 Replies
8. Shell Programming and Scripting
why is this giving me errors?
i type this in: find / -name "something.txt" 2>/dev/null
i get the following error messages:
find: bad option 2
find: path-list predicate-list
:confused: (5 Replies)
Discussion started by: magiling
5 Replies
9. Shell Programming and Scripting
Hi,
We have a shell script which looks into a directroy for any folder older than 30 days and removes them. The command being used is
find $ARCHIVE_DIR -type d -mtime +$PURGE_HIST_DAYS -exec rm -rf {} \;
It removes some folders but then throw below errors for others:
find:... (2 Replies)
Discussion started by: DejaVu
2 Replies
10. Shell Programming and Scripting
Today is my first day in shell scripting.
I am not able to find error.
Need Help!
Error is :-
syntax error near unexpected token `then'
test.sh: line 50: ` if; then
echo "Enter Path o(if empty file will be unzipped to /var/www/):" read path
echo... (3 Replies)
Discussion started by: sunny2802
3 Replies
LEARN ABOUT LINUX
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)