Search Results

Search: Posts Made By: wthomas
4,624
Posted By purdym
If this is a one time search, and you're going to...
If this is a one time search, and you're going to throw the code away:

grep "Dec 4 11:[0-1][0-5]" filename
Forum: Solaris 11-03-2010
3,525
Posted By vishalaswani
The problem with your script is you are reading...
The problem with your script is you are reading messages file again from top without ignoring what has been read previously.

You can use the below solution.


while true
do
if [ ! -f...
Forum: Solaris 11-02-2010
3,525
Posted By Neo
There are thousands of examples of code on this...
There are thousands of examples of code on this site that searches a file and performs some pattern matching. If you search the site, you will find plenty of examples.
2,200
Posted By jim mcnamara
-F '%' - this defines % as the primary field...
-F '%' - this defines % as the primary field separator.

split($1, a, " ") - using field $1 (field #1 ) create an array that is split up using space(s) as the separator, creating subfields out of...
2,555
Posted By bakunin
This is a VERY VALUABLE suggestion which...
This is a VERY VALUABLE suggestion which relevance can't be overestimated. The "number 1 cron problem" is like this:

i have written script x and it works fine from the command line and after i put...
2,555
Posted By methyl
Firstly. There is never ever a reason to use...
Firstly. There is never ever a reason to use "for" when dealing with an open-ended list.
Secondly. Convoluted one-liners should be formatted scripts.




This "while" construct easier to read...
2,555
Posted By Poonamol
Hope you know all vi editor options. From...
Hope you know all vi editor options.
From command prompt do,
vi scriptname
then insert
#!/bin/bash
as first line followed by anything u want to do.
Save it and run it.
1,759
Posted By bartus11
tail messages | tr -s " " | cut -d" "...
tail messages | tr -s " " | cut -d" " -f4,9-
1,703
Posted By bartus11
Right. I've put Perl line in wrong place. This...
Right. I've put Perl line in wrong place. This should work (also notice the added "\n"):for messages in `cat syslog_message_list.txt`
do
grep $messages syslog.`date +%d%m%y`.log | awk '{print $4 "...
4,240
Posted By methyl
Can you put code tags round the sample. I bet...
Can you put code tags round the sample. I bet that there are two spaces between "Oct 6".
If this is the case you can generate a matching date like this.

DDMMM="`date '+%b %e'`" #...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy