I have ASCII files to parse that 48 hours old or more ; I can identify them like so
Some files have a list of hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like so
This grep statement works but it seemingly overrides the find() statement above if I run both at the same time... How can I combine the two statements to create a report that lists the filename and error(s) like so
Is it possible to return "No error" with the file name without error? Thanks in advance for your help.
Hi,
With grep -ci word * I get a list of files either they have a hit, or the have not (0).
I wanted to pipe to a new list of files, which only shows the files where the string was found, and counted, not the whole bunch.
How to do this?
Any advice welcome!
with best regards,
Omar... (11 Replies)
I have a script like this:
echo "enter filername in lowercase"
read -e filername exec 2>&1
echo "type the start date in format MM/DD/YYYY"
read -e startdate exec 2>&1
echo "enter the end date in format MM/DD/YYYY"
... (2 Replies)
Hi,
in a script I will do :
grep ORA- mylogfile.log
If it returns any ORA- (oracle error) I whant to have :
echo "subject : RMAN in Error " >> /appli/rap.txt
But if no error
echo "subject : RMAN OK " >> /appli/rap.txt
Can you help me ?
The grep return code would it be... (1 Reply)
Hi,
I have a lot of log files which contain lines in the format of (date info) or (info), and when I use grep to search for "date" I was able to get the (date info) line, but some info lines are a separate line after the (date info) line... for example like:
(date info info info)
(date... (8 Replies)
Hello,
I looking to use grep to return a string with exactly n matches.
I'm building off this:
ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '
-rwxr-xr-x 1 root root 632816 Nov 25 2008 vi
-rwxr-xr-x 1 root root 632816 Nov 25 2008 view
-rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
hi,
i am running this command inside the script
var=`grep -il $1 "${logdir}"* | xargs grep -ivl adding | xargs grep -ivl equation | xargs ls -ctr | tail -1`
in that grep will find the latest logfile for the variable "$"
if it fnd the logfile, then it reutrns the filename to the var
if... (1 Reply)
Hi there,
I am writing a script to look for tmp log files that have not been access within the last 10 days.
I am using the follwing command within the script:
find /var/tmp -name *log -atime -9 ¦xargs
What I would like to be able to do would be to display a message if there is no... (3 Replies)