Sponsored Content
Top Forums Shell Programming and Scripting need to grep contents of a file within specific time span. regex i am using is not working Post 302648653 by elixir_sinari on Wednesday 30th of May 2012 07:56:00 AM
Old 05-30-2012
Quote:
Originally Posted by black_fender
The man's question (from what I understood ) was why his command doesn't provide the desired output and not what other command could provide the desired output.
I am not asking chidori to use a different command but the same command with an additional option with the regex untouched. By the way, have you tried your regex? I don't think it works.

The IREs don't require escaping in grep (unlike may be in sed).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading specific contents from a file and appending it to another file

Hi, I need to write a shell script (ksh) to read contents starting at a specific location from one file and append the contents at specific location in another file. Please find below the contents of the source file that I need to read the contents from, File 1 -----# more... (5 Replies)
Discussion started by: dnicky
5 Replies

2. Shell Programming and Scripting

awk - print file contents except regex

Hello, I have a file which has user information. Each user has 2 variables with the same name like Email: testuser1 Email: testuser1@test.com Email: testuser2 Email: testuser2@test.com My intention is to delete the ones without the '@' symbol. When I run this statement awk '/^Email:/&&!/@/'... (6 Replies)
Discussion started by: rmsagar
6 Replies

3. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

4. UNIX for Dummies Questions & Answers

Extracting a Time Span from Syslog Messages File

Hi all, I need your help to explain how I can extract a time span from the syslog messages file on a Solaris 10 system. Here is an example extract of the syslog messages: Dec 4 11:51:38 hajap141-0107.nls.jlrint.com 267938: Dec 4 11:51:36: %DOT11-6-DISASSOC: Interface Dot11Radio0,... (4 Replies)
Discussion started by: wthomas
4 Replies

5. Shell Programming and Scripting

How to replace specific contents in a file?

From the existing file, I need to replace specific contents possibly with var every time when the user changes the var. e.g the contents in the file file.txt is 'My name is $n and I am $y years old' and every time user changed the var outside the file, the contents of the file should be created... (4 Replies)
Discussion started by: Emilywu
4 Replies

6. Shell Programming and Scripting

select the lines in between some time span

Hi Everyone ! i want to take all the lines from a file that falls in between some date... and every line in a file has a time stamp.. ---some text---- 01/Jan/2010 ---- some other text ---- ---some text---- 10/Jan/2010 ---- some other text ---- ---some text---- 20/Dec/2010 ---- some... (3 Replies)
Discussion started by: me_newbie
3 Replies

7. UNIX for Dummies Questions & Answers

Looping/Reading file contents not working

Hi, I am doing something basic, but I am missing something. Im trying to read the contents of a file and taking those values and connecting to a database. However, it only connect to one (or reads in) value and then exists. Here is what it looks like: listname.txt db1 db2 db3 Script:... (15 Replies)
Discussion started by: DBnixUser
15 Replies

8. Shell Programming and Scripting

awk to place specific contents filename within text file

I am trying to use awk to place the contens of a filename in $1 and $2 followed by the data in the text file. Basically, put the filename within the text file. There are over 1000 files in the directory and as of now each file is saved with a unique name but it is not within the file. Thank you... (10 Replies)
Discussion started by: cmccabe
10 Replies

9. UNIX for Beginners Questions & Answers

Total size utilizes by the files older than a time span

Through find command I identified the files older that 1 year. I need the overall size utilizes by these 1 year older files. Please share me the command to identify it .Thanks Please post in an adequate technical forum! (3 Replies)
Discussion started by: Sang
3 Replies

10. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies
runacct(1M)						  System Administration Commands					       runacct(1M)

NAME
runacct - run daily accounting SYNOPSIS
/usr/lib/acct/runacct [ mmdd [state]] DESCRIPTION
runacct is the main daily accounting shell procedure. It is normally initiated using cron. runacct processes connect, fee, disk, and process accounting files. It also prepares summary files for prdaily or billing purposes. runacct is distributed only to source code licensees. runacct takes care not to damage active accounting files or summary files in the event of errors. It records its progress by writing descriptive diagnostic messages into active. When an error is detected, a message is written to /dev/console, mail (see mail(1)) is sent to root and adm, and runacct terminates. runacct uses a series of lock files to protect against re-invocation. The files lock and lock1 are used to prevent simultaneous invocation, and lastdate is used to prevent more than one invocation per day. runacct breaks its processing into separate, restartable states using statefile to remember the last state completed. It accomplishes this by writing the state name into statefile. runacct then looks in statefile to see what it has done and to determine what to process next. states are executed in the following order: SETUP Move active accounting files into working files. WTMPFIX Verify integrity of wtmpx file, correcting date changes if necessary. CONNECT Produce connect session records in tacct.h format. PROCESS Convert process accounting records into tacct.h format. MERGE Merge the connect and process accounting records. FEES Convert output of chargefee into tacct.h format, merge with connect, and process accounting records. DISK Merge disk accounting records with connect, process, and fee accounting records. MERGETACCT Merge the daily total accounting records in daytacct with the summary total accounting records in /var/adm/acct/sum/tacct. CMS Produce command summaries. USEREXIT Any installation dependent accounting programs can be included here. CLEANUP Clean up temporary files and exit. To restart runacct after a failure, first check the active file for diagnostics, then fix any corrupted data files, such as pacct or wtmpx. The lock, lock1, and lastdate files must be removed before runacct can be restarted. The argument mmdd is necessary if runacct is being restarted. mmdd specifies the month and day for which runacct will rerun the accounting. The entry point for processing is based on the contents of statefile; to override this, include the desired state on the command line to designate where processing should begin. EXAMPLES
Example 1: Starting runacct The following example starts runacct: example% nohup runacct 2> /var/adm/acct/nite/fd2log & Example 2: Restarting runacct The following example restarts runacct: example% nohup runacct 0601 2>> /var/adm/acct/nite/fd2log & Example 3: Restarting runacct at a Specific State The following example restarts runacct at a specific state: example% nohup runacct 0601 MERGE 2>> /var/adm/acct/nite/fd2log & FILES
/var/adm/wtmpx History of user access and administration information /var/adm/pacctincr /var/adm/acct/nite/active /var/adm/acct/nite/daytacct /var/adm/acct/nite/lock /var/adm/acct/nite/lock1 /var/adm/acct/nite/lastdate /var/adm/acct/nite/statefile ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWaccu | +-----------------------------+-----------------------------+ SEE ALSO
acctcom(1), mail(1), acct(1M), acctcms(1M), acctcon(1M), acctmerg(1M), acctprc(1M), acctsh(1M), cron(1M), fwtmp(1M), acct(2), acct.h(3HEAD), utmpx(4), attributes(5) NOTES
It is not recommended to restart runacct in the SETUP state. Run SETUP manually and restart using: runacct mmdd WTMPFIX If runacct failed in the PROCESS state, remove the last ptacct file because it will not be complete. The runacct command can process a maximum of o 6000 distinct sessions o 1000 distinct terminal lines o 2000 distinct login names during a single invocation of the command. If at some point the actual number of any one of these items exceeds the maximum, the command will not succeed. Do not invoke runacct at the same time as ckpacct, as there may be a conflict if both scripts attempt to execute turnacct switch simultane- ously. SunOS 5.10 11 May 1999 runacct(1M)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy