Sponsored Content
Top Forums Shell Programming and Scripting record wc -l over 24 hour period Post 92340 by csaunders on Friday 9th of December 2005 11:28:05 AM
Old 12-09-2005
wait, im not following the "echo date". Wont this output just "date".
And if I do another pipe i.e.

echo "dis chs(*)" | runmqsc | grep RUNNING | wc -l | date
Fri Dec 9 11:21:08 EST 2005

I dont get the wc -l

any ideas?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

an hour less in 24 hour system

My program: __________________________________ #!/bin/ksh DAY=`date +%y%m%d` H=`date +%H` M=`date +%M` day=`date +%m/%d/%y` let h=$H-1 echo DAY $DAY echo H $H echo M $M echo day $day echo h $h _____________________________________ My result: (3 Replies)
Discussion started by: bobo
3 Replies

2. Shell Programming and Scripting

counting word xx referred to a time period, like minute or hour

Hello, I try to insert a post because I've got a trouble to perform a unix job. But I didn't found which steps (procedure) I should follow. Could you help me? I got a log by my Application box, like following: gbosmam037:test >view Log_Server.csv ... (2 Replies)
Discussion started by: maluca68
2 Replies

3. Shell Programming and Scripting

Reject the record if the record in the next line does not satisfy the pattern

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten The output should be 1one 2two 3three 1four 2five 3six (2 Replies)
Discussion started by: supchand
2 Replies

4. Shell Programming and Scripting

Reject the record if the record in the next line does not begin with 2.

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten 2eleven 2twelve 1thirteen 2fourteen The output should be: (5 Replies)
Discussion started by: supchand
5 Replies

5. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

6. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

7. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

8. Shell Programming and Scripting

Replace a string for every record after the 1st record

I have data coming in the below format for each record <?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><testdetials>....</test_sox> <?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox... (8 Replies)
Discussion started by: dsravanam
8 Replies

9. Shell Programming and Scripting

Need code for updating second record to first record in shell scripting

Hi,, I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows.. SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies

10. UNIX for Beginners Questions & Answers

Disk usage monitoring and record the disk used in last 24 hour

HI I am Trying to edit the below code to send email every day with difference of disk utilized in for last 24 hours but instead getting same usage everyday. can you please help me to point out where my calculation is going wrong. Thank you. ================= #!/bin/bash TODAY="at $(date... (0 Replies)
Discussion started by: Mi4304
0 Replies
acctcon(8)						      System Manager's Manual							acctcon(8)

NAME
acctcon1, acctcon2 - Display connect-time accounting summaries SYNOPSIS
acctcon1 [-l file] [-o file] [-p] [-t] acctcon2 FLAGS
Writes line-usage format from the input file (usually /var/adm/wtmp) to file for the accounting period during which the file /var/adm/wtmp is active. The following example shows the ASCII line-usage heading format: TOTAL DURATION: 57 MINUTES LINE MINUTES PERCENT # SESS # ON # OFF pty/ttyp4 37 64 3 3 7 console 26 45 2 2 4 pty/ttyp5 7 11 1 1 3 pty/ttyp6 0 0 0 0 2 TOTALS 69 - 6 6 16 TOTAL DURATION specifies the total number of minutes used for connect sessions during the accounting period during which the /var/adm/wtmp file is active. The columns specify the line name, the number of session minutes used, the percentage of total elapsed time used for the sessions, the number of sessions charged, the number of logins, and the number of logouts. The last line in the line-usage file totals the entries for each column. The line-usage format helps to track line usage and identify bad lines. All hangups, terminations of the login command, and termi- nations of the login shell cause the system to write logout records, so that the number of logouts is often greater than the number of sessions. Writes an overall-record format to file from the input file (usually /var/adm/wtmp) for the accounting period during which the /var/adm/wtmp file is active. The following example shows the overall-record format: from mon day date hh:mm:ss yyyy tz to mon day date hh:mm:ss yyyy tz 2 date changes Number of times the date was changed. 21 acctg off Number of times accounting functions were turned off. 25 run-level S Number of times accounting functions ran in single-user mode. 108 system boot Number of times the system was rebooted. 21 acctg on Number of times accounting functions were turned on. 21 acctcon1 Number of times the acctcon1 command was issued. The first lines specify the date and time stamp, including time zone, of the accounting period start time and end time. Writes the input file (usually /var/adm/wtmp) to the default output device. For example: pty/ttyp1 hoff 616883748 Jul 19 16:35:48 1990 EST pty/ttyp1 hoff 616883825 Jul 19 16:37:05 1990 EST pty/ttyp1 LOGIN 616883833 Jul 19 16:37:13 1990 EST pty/ttyp1 tom 616883837 Jul 19 16:37:17 1990 EST The output columnar format lists the line reference name, the login name, the time in seconds since January 1, 1970, 0 hours, 0 min- utes, 0 seconds, the date, the 24-hour clock time, the year, and the time zone. Uses the last time found in the input file as the ending time for any current processes. This time, rather than current time, is necessary to have reasonable and repeatable values for noncurrent files. The output format is the same as the default output format. The acctcon1 command also maintains a list of ports on which users are logged in. When the acctcon1 command reaches the end of its input, a session record is written for each port that still appears to be active. The acctcon1 command assumes that the input source is the current file and uses current time as the ending time for each session still in progress. DESCRIPTION
The acctcon1 and acctcon2 commands are described separately. acctcon1 The acctcon1 command is invoked by the runacct shell procedure to write a sequence of login and logout records. One record for each con- nect session is written to the specified destination as a sequence of login session records. The /var/adm/wtmp source file should be directed as input to the command. The following example shows the default ASCII columnar output format: 285212673 1192 hoff 85 0 616883748 Jul 19 16:35:48 1990 EST 285212673 1033 tom 10 0 616883837 Jul 19 16:37:17 1990 EST 285212673 0 root 1345 2852 616883855 Jul 19 16:37:35 1990 EST 285212673 1120 jim 0 62 616888058 Jul 19 17:47:38 1990 EST The columns contain the following information: Device address, expressed as a decimal equivalent of the major/minor device address at which the connection was activated. User ID assigned for the connect-session record. Login name under which the session took place. Total num- ber of prime-time seconds for the connect session. Total number of nonprime-time seconds for the connect session. Seconds since the date 0 hours, 0 minutes 0 seconds, 1 January 1970. Month, day of the month, connect-session starting time, year, and time zone. The order of date and time information is locale dependent. The timestamps shown use the default format for date and time values; however, you can define the NLTIME environment variable to change this format. acctcon2 The acctcon2 command is invoked by the runacct shell procedure. It converts a sequence of login session records produced by the acctcon1 command into connect-time total accounting records. These records are often merged with other total accounting records with the acctmerg command to produce a daily report. EXAMPLES
The following example converts login records to a default format login session record report: acctcon1 -t /var/adm/lineuse -o /var/adm/reboots < /var/adm/wtmp > /var/adm/logsess The previous example generates three files. The /var/adm/logsess file lists ending date and 24-hour timestamp records that correspond with the last time that input was obtained with the -t flag. For the accounting period covered by the /var/adm/wtmp file, the /var/adm/lineuse line-usage summary file is generated by the -l flag, and the /var/adm/reboots overall record file is obtained with the -o flag. The following example converts a series of login session records in the /var/adm/logsess file to a total accounting record in the /var/adm/logacct binary file: acctcon2 < /var/adm/logsess > /var/adm/logacct FILES
Specifies command path. Specifies command path. The active login/logout database file. Accounting header files that define formats for writing accounting files. RELATED INFORMATION
Commands: login(1), acct(8), acctmerg(8), fwtmp(8), init(8), wtmpconvert(8). Functions: acct(2). delim off acctcon(8)
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy