Sponsored Content
Full Discussion: erroneous output
Top Forums Programming erroneous output Post 302126378 by blowtorch on Wednesday 11th of July 2007 08:56:44 AM
Old 07-11-2007
Quote:
Originally Posted by bishweshwar
why the last line is being read two times
It isn't being read twice, it is being written(printed) twice. As porter has suggested, check the return value on your fscanf and exit if it is EOF.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting a File with an Erroneous Period

Hi - I am new to the Unix environment and have encountered a problem I can't resolve. I inadvertently created a data file with a period/dot at the end of the word 'dat', I.e. filename.dat. and can't remove it using the 'rm' command. In attempting to do so, I receive a message reading that the... (3 Replies)
Discussion started by: PLF
3 Replies

2. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

3. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

4. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

5. Shell Programming and Scripting

Displaying log file pattern output in tabular form output

Hi All, I have result log file which looks like this (below): from the content need to consolidate the result and put it in tabular form 1). Intercomponents Checking Passed: All Server are passed. ====================================================================== 2). OS version Checking... (9 Replies)
Discussion started by: Optimus81
9 Replies

6. Shell Programming and Scripting

Erroneous file concatenation.

I have more than one files in a directory , namely GLOW_OUT.txt FIELD_OUT.txt BASE_OUT.txt ... SHOW_OUT.txt What I wanted to do is to I am working in Korn Shell What I did was : for file in <directory_name>/*.* ;do cat $file | grep -v '^$' >> temp_file rm $file done ... (7 Replies)
Discussion started by: kumarjt
7 Replies
FERROR(3)						   BSD Library Functions Manual 						 FERROR(3)

NAME
clearerr, clearerr_unlocked, feof, feof_unlocked, ferror, ferror_unlocked, fileno, fileno_unlocked -- check and reset stream status LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> void clearerr(FILE *stream); void clearerr_unlocked(FILE *stream); int feof(FILE *stream); int feof_unlocked(FILE *stream); int ferror(FILE *stream); int ferror_unlocked(FILE *stream); int fileno(FILE *stream); int fileno_unlocked(FILE *stream); DESCRIPTION
The function clearerr() clears the end-of-file and error indicators for the stream pointed to by stream. The function feof() tests the end-of-file indicator for the stream pointed to by stream, returning non-zero if it is set. The end-of-file indicator may be cleared by explicitly calling clearerr(), or as a side-effect of other operations, e.g. fseek(). The function ferror() tests the error indicator for the stream pointed to by stream, returning non-zero if it is set. The function fileno() examines the argument stream and returns its integer descriptor. The clearerr_unlocked(), feof_unlocked(), ferror_unlocked(), and fileno_unlocked() functions are equivalent to clearerr(), feof(), ferror(), and fileno() respectively, except that the caller is responsible for locking the stream with flockfile(3) before calling them. These func- tions may be used to avoid the overhead of locking the stream and to prevent races when multiple threads are operating on the same stream. ERRORS
These functions should not fail and do not set the external variable errno. SEE ALSO
open(2), fdopen(3), flockfile(3), stdio(3) STANDARDS
The functions clearerr(), feof(), and ferror() conform to ISO/IEC 9899:1990 (``ISO C90''). BSD
January 28, 2009 BSD
All times are GMT -4. The time now is 11:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy