Sponsored Content
Top Forums Shell Programming and Scripting Find and awk with today's date Post 302932601 by Chubler_XL on Thursday 22nd of January 2015 05:45:22 PM
Old 01-22-2015
Here is a solution that displays the count of lines containing "NS Primary Error" within all files containing "2015-01-22":

Code:
find /oracle/diag/rdbms/*/*/trace -type f -name '*d00*.trc' -mtime 0  -exec awk '
    function pa() { if(FN) print FN":"CNT }
    FNR==1{pa(); FN=CNT=x }
    /2015-01-22/ {FN=FILENAME}
    /NS Primary Error/{CNT++}
    END{pa()}' '{}' '+'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compare today's date with date in a file

Hi I am very new to scripting, Can someone show me how to (in unix shell script) compare the system's date with a date in a file. The requirement is to somehow open this file (which will only have a date in it) and compare it with today's date. If they are equal execute a procedure below but if... (4 Replies)
Discussion started by: siog
4 Replies

2. UNIX for Dummies Questions & Answers

Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete

Hello, I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
Discussion started by: citizencro
3 Replies

3. Shell Programming and Scripting

Find file that matches today's date in filename and move to /tmp in bash

I'm having problems with my bash script. I would like to find a file matching today's date in the filename, i.e. my_file_20120902.txt and then move it to a different directory, i.e. /tmp. Thanks. (1 Reply)
Discussion started by: jamesi
1 Replies

4. Shell Programming and Scripting

[Solved] Replace yesterday date with today's date except from the first line

Hello, I have a file like this: 2012112920121130 12345620121130msABowwiqiq 34477420121129amABamauee e7748420121130ehABeheheei in case the content of the file has the date of yesterday within the lines containing pattern AB this should be replaced by the current date. But if I use... (3 Replies)
Discussion started by: Lilu_CK
3 Replies

5. Shell Programming and Scripting

UNIX date fuction - how to deduct days from today's date

Hi, One of my Unix scripts needs to look for files coming in on Fridays. This script runs on Mondays. $date +"%y%m%d" will give me today's date. How can I get previous Friday's date.. can I do "today's date minus 3 days" to get Friday's date? If not, then any other way?? Name of the files is... (4 Replies)
Discussion started by: juzz4fun
4 Replies

6. Shell Programming and Scripting

Need to add a date column (today's date) in file

Hi I have file with number status and date1 and date1 field, want add a column today between column date1 and date2. file1.txt number status date1 date2 ===== ==== === ===== 34567 open 27/06/13 28/06/13 45678 open 27/06/13 28/06/13 43567 open 27/06/13 28/06/13 ... (1 Reply)
Discussion started by: vijay_rajni
1 Replies

7. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

8. Shell Programming and Scripting

Check, if date is not today

hello, in a file exist entries in date format YYYYMMDD. i want to find out, if there are dates, which isn't today's date. file: date example text 20140714 <= not today's date 20140715 <= not today's date 20140716 <= today's date my idea is to use Perderabo's datecalc ... (2 Replies)
Discussion started by: bora99
2 Replies

9. UNIX for Beginners Questions & Answers

Find and copy .zip file based on today's date

Hi Team, I'm new to unix and i have a requirement to copy or move files from one directory to another based on current date mentioned in the .zip file name. Note that i need to copy only the recent zip file. please help me with the code i tried the code as: #! /usr/bin/sh find... (3 Replies)
Discussion started by: midhun3108
3 Replies

10. UNIX for Beginners Questions & Answers

Compare Date to today's date in shell script

Hi Community! Following on from this code in another thread: #!/bin/bash file_string=`/bin/cat date.txt | /usr/bin/awk '{print $5,$4,$7,$6,$8}'` file_date=`/bin/date -d "$file_string"` file_epoch=`/bin/date -d "$file_string" +%s` now_epoch=`/bin/date +%s` if then #let... (2 Replies)
Discussion started by: Greenage
2 Replies
isl(1M) 																   isl(1M)

NAME
isl - initial system loader DESCRIPTION
implements the operating system independent portion of the bootstrap process. It is loaded and executed after self-test and initialization have completed successfully. The processor contains special purpose memory for maintaining critical configuration related parameters (e.g. Primary Boot, Alternate Boot, and Console Paths). Two forms of memory are supported: Stable Storage and Non-Volatile Memory (NVM). Typically, when control is transferred to an sequence takes place. An sequence allows a complete bootstrap operation to occur with no intervention from an operator. executes commands from the file in a script-like fashion. is enabled by a flag in Stable Storage. is a mechanism that automatically locates the boot and console devices. For further information, see pdc(1M). During an sequence, displays its revision and the name of any utility it executes. However, if is disabled, after displays its revision, it then prompts for input from the console device. Acceptable input is any command name or the name of any utility available on the sys- tem. If a non-fatal error occurs or the executed utility returns, again prompts for input. Commands There are several commands available in although not all commads are supported on cellular systems . The following is a list with a short description. Parameters may be entered on the command line following the command name. They must be separated by spaces. prompts for any necessary parameters that are not entered on the command line. Help - List commands and available utilities List available utilities Enable or disable the autoboot sequence Parameter - or Enable or disable the sequence Parameter - or Modify the Primary Boot Path Parameter - Primary Boot Path in decimal Modify the Alternate Boot Path Parameter - Alternate Boot Path in decimal Modify the Console Path Parameter - Console Path in decimal List contents of the file Display the Primary Boot, Alternate Boot, and Console Paths Display the contents of one word of NVM in hexadecimal Parameter - NVM address in decimal or standard hexadecimal notation Display the contents of one word of Stable Storage in hexadecimal Parameter - Stable Storage address in decimal or standard hexadecimal notation DIAGNOSTICS
displays diagnostic information through error messages written on the console and display codes on the LED display. For the display codes, are informative only. and indicate errors, some of which are fatal and cause the system to halt. Other errors merely cause to display a message. Non-fatal errors during an sequence cause the sequence to be aborted and to prompt for input. After non-fatal errors during an interactive session, merely prompts for input. Fatal errors cause the system to halt. The problem must be corrected and the system RESET to recover. is executing. is from the file. Cannot find an file. aborted. No console found, can only Directory of utilities is too big, reads only 2K bytes. file is inconsistent. aborted. Utility file header inconsistent: SOM values invalid. file input string exceeds 2048 characters. aborted. command or utility name exceeds 10 characters. has transferred control to the utility. Internal inconsistency: Volume label - Internal inconsistency: Directory - Error reading file. Error reading from console - Error writing to console - Not an command or utility. Utility file header inconsistent: Invalid System ID. Error reading utility file header. Utility file header inconsistent: Bad magic number. Utility would overlay in memory. Utility requires more memory than is configured. Error reading utility into memory. Incorrect checksum: Reading utility into memory. Console needed - Internal inconsistency: Boot device class - Destination memory address of utility is invalid. Utility file header inconsistent: pdc_cache entry. Internal inconsistency: iodc_entry_init - Internal inconsistency: iodc_entry_init - console - Internal inconsistency: iodc_entry_init - boot device - Utility file header inconsistent: Bad aux_id. Bad utility file type. SEE ALSO
boot(1M), pdc(1M). PA-RISC Systems Only isl(1M)
All times are GMT -4. The time now is 07:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy