Sponsored Content
Full Discussion: C reading file
Top Forums Programming C reading file Post 302305985 by pludi on Friday 10th of April 2009 10:58:45 AM
Old 04-10-2009
Let's assume you have a file like this:
  1. This is line 1
  2. Line 2
  3. And finally line 3
Do you want to have a result like:
  1. This is line 1
  2. This is line 1
or:
  1. This is line 1
  2. Line 2
  3. And finally line 3
  4. This is line 1
or something completely else?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

2. UNIX for Advanced & Expert Users

Reading a file and sending mail based on content of the file

Hi Gurus, I am having an requirement. i have to read a list file which contains file names and send mail to different users based on the files in the list file. eg. if file a.txt exists then send a mail to a@a.com simillary for b.txt,c.txt etc. Thanks for your help, Nimu (6 Replies)
Discussion started by: nimu1979
6 Replies

3. UNIX for Dummies Questions & Answers

Reading from a file(passing the file as input parameter)

hi I have a shell script say primary.sh . There is a file called params my scenario is primary.sh should read all the values and echo it for example i should pass like $primary.sh params output would be Abc ... (2 Replies)
Discussion started by: ssuresh1999
2 Replies

4. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

5. Shell Programming and Scripting

fatal: cannot open file `TNAME' for reading (No such file or directory)

Hi, I am running this command through a shell script and getting the error mentioned in the subject line: testing.awk -f x.txt TNAME My testing.awk file contains something like ++++++++++++++++++ #!/usr/bin/awk -f BEGIN{ TAB_NAME="INSERT_ONE_" ARGV ; } if ( $1=="JAM_ONE" &&... (1 Reply)
Discussion started by: kunwar
1 Replies

6. Shell Programming and Scripting

Reading UNIX commands from file and redirecting output to a file

Hi All I have written the following script: #!/bin/ksh while read cmdline do echo `$cmdline` pid="$cmdline" done<commands.txt =========== commands.txt contains: ps -ef | grep abc | grep xyz |awk '{print $2}; My objective is to store the o/p of the command in a variable and do... (8 Replies)
Discussion started by: rahulparo
8 Replies

7. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

8. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

9. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
NNACCT(1m)																NNACCT(1m)

NAME
nnacct - news accounting and access authorization (nn) SYNOPSIS
nnacct -r [ -f file ] [ -a ] [ user ]... nnacct [ -ppolicy ] [ -qquota ] user... nnacct -ZERO DESCRIPTION
The nnacct command provides an optional accounting and access authorization for news reading via the nn news reader. The first form (-r) is used to print accounting reports. If a file is specified data from a saved accounting file; otherwise the data is read from the current accounting file. If -a is specified, the report will contain accounting data for all users. Otherwise, if one or more users are specified, the data for these users will be printed. If neiter is specified, only the accounting data for the current user is printed. Only the super-user can generate reports for other users than the caller. The second form (-p and/or -q) assigns the specified access policy and/or quota to the specified users. If a given user is not already known in the accounting file, a new entry with the specified policy and quota is created (default values are used if both are not speci- fied). The third form (-ZERO) will clear the usage counts for all users. Individual usage counts cannot be cleared. The original accounting file is saved with a .old suffix. The following policies are currently implemented: 0 No access. The user is not allowed to read news at all. 1 Privileged user. The user can read news at all times and no accounting information is saved. This is obviously the policy for sys- tem administrators :-) 2 Full time access. The user can access news at all times. 3 Off-hours access. The user can only access news at off hours, i.e. in the morning, in the evening, on week-ends, and on holidays (not complete - check the source :-) The quota specifies a number of hours which the user is allowed to read news. When this quota is used up, access will be blocked. A quota of zero gives unlimited access. New users will get the default policy and quota defined in account.c. If this allows new users to read news at only specific times, this form can be used to permit individual users to read news at all times, or it can be used to prevent them from reading news at all. If the default policy does not allow new users to read news, this form must be used to authorize them to read news. HOW IT WORKS
If authorization is enabled, the nn news reader will call nnacct on start-up to check whether the policy and quota defined for the current user allows him to read news at this time (or at all). If accounting is enabled, the nn news reader will call nnacct on exit to register the time spent on news reading. If account logging is also defined (see account.c), an line is also added to the accounting log file. When accounting is defined, the user can use the :cost command to get the current accounting data, and if the variable report-cost is set, nn will print accounting information on exit. CONTIGURATION AND NEW POLICIES
The use of nnacct is enabled via the ACCOUNTING and AUTHORIZE symbols in nn's configuration file. Further configuration of cost calcula- tions, logging, default policy, default quotas, etc. is done directly in the source file account.c. New access policies can also be defined in this file. This allows you to change the policies or prices without having to recompile the whole package since only nnacct is modified. PRIVILEGED USERS
Normally, only root is allowed to change user policy or quota, list all user's accounting data etc. This privilege can be shared with other users by listing their login name in the file $CLIENT/admins. There should be exactly one login name per line, and no blanks are allowed. FILES
$db/acct accounting data (accumulated per user) $db/acctlog accounting log (grows indefinitely) $lib/admins login names of privileged nnacct users. SEE ALSO
nn(1), nnusage(1) BUGS
There should be some tools to mess around with the accounting files, e.g. to make summaries, clear usage counters, etc. AUTHOR
Kim F. Storm, Texas Instruments A/S, Denmark E-mail: storm@texas.dk 4th Berkeley Distribution Release 6.6 NNACCT(1m)
All times are GMT -4. The time now is 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy