General :: Awk Script To Select Range From File?
Nov 25, 2009
I have a file generated in every event occurred. In this file i have a entries like bellow
<without blank line after Summary>
Summary: Adapter at hardware path 0/6/1/0 :Received an interrupt indicating that a
primitive was transmitted
and sometimes like bellow
<with blank line after Summary>
Summary: Adapter at hardware path 0/6/1/0 :Received an interrupt indicating that a primitive was transmitted What I need is to extract the Summary from the file. I have the following awk script. But it only works if there is no blank line after Summary.
cat server.event.txt|awk '/^Sum/,/^$/'
But I need up to second blank lines after Summary.
View 8 Replies
ADVERTISEMENT
Jun 24, 2011
I want to search in my apache log, for events which have occurred say between 11:00 AM to 2:00 PM. I have got few scripts/commands but they are not conclusive, some of then are trying to do an exact match(awk) and for some i am just getting the pattern wrong (eGrep)
I am running RHEL.
Apache log eg:
================================================================
10.92.120.129 - - [24/Jun/2011:01:29:07 -0500] "GET /favicon.ico HTTP/1.1" 302
================================================================
now if i want to find out the logs from 1 PM to 2 PM
some example i had was:
cat <apache.log> | grep -E '07/Apr/20110[1-2]:[0-5][0-9]|02:00)'
small script in which i can pass the start time and end time range, and it should give an output of the rows which fall under that time range.
View 5 Replies
View Related
Jan 25, 2010
I use KDE Dolphin to move pdf file to another folder. When I click on it Dolphin stop responding for a minute. Is there any option to disable or not to preview the file or else? I am annoyed when have to wait so long time just to select a file.
View 3 Replies
View Related
Oct 6, 2010
I open a file in Ubuntu nano editor from the comand line and I want to copy all the contents of the file so I can paste it in an another application outside the shell. So far I can only copy using shift on the screen that is visible but not on all content.
View 4 Replies
View Related
Jun 27, 2011
Working fine: ==> scp my_log-bin.01393[0-9] root@192.168.103.66:/backup/ error - No such file or directory: ==> scp my_log-bin.0139[30-99] root@192.168.103.66:/backup/
View 4 Replies
View Related
Dec 7, 2009
I have an application for loading data into MySQL table using php, through excel-Reader. php is set up on the localhost and the web-page is available from: [url]
The code of xlr2.php:
When I open the page, I get the message to choose a file with the file-dialog box and the notice as:
Notice: Undefined index: action in /var/www/html/xlr/xlr2.php on line 10
Default Action:
Choose a file to Load into MySQL:
Why so? I am selecting file from ("/home/lx/myDocuments/tech/excel/smslist.xls"), but the warning says that [failed to open stream: No such file or directory in /var/www/html/xlr/xlr2.php on line 33]. A different directory than I selected.
View 1 Replies
View Related
Jun 23, 2009
get me understand the short range and the long range links from routing (and routing protocols') point of view.
View 6 Replies
View Related
Apr 24, 2011
I want to plot a set of data in only one plot.The problem is that some points of the data should be better plotted in a linear scale (lets say 0 to 100,000) but there are other data points that, exceding the value 100,000, would be better plotted in a logarithmic scale, as they goes in the range 100,000 to 500,000,000. Let's say the data is:
Code:
X Y
0 100
10000 80
20000 75
[code]....
Is there a way to plot all these points in the same plot in only one X-axis showing two different ranges in that axis: linear: 0-100,000 logarithmic: 100,000 - 1,000,000,000?The axis would be read, for example, as:
Code:
|-----|-----|-----|-----|-----|-----|-----|-----|-----|
0 20k 40k 60k 80k 100k 1M 10M 100M 1G
(The abbreviations k-M-G are not the important point. Just shown for clarity)
View 2 Replies
View Related
Apr 11, 2011
I want to build a bash script, which can ping a range IP adresses which will be filled in by the admin. If there is no IP-adress filled in, then the script must ping the subnet where the system is logged on. So if my ip is 192.168.1.6, then the script must ping from 192.168.1.1 till 192.168.1.255 Or else, if there is given a beginning and ending ip it must ping that!
The first part of the bash script is to ping a given range (see below). But there is one problem, how can I tell the script to ping from $begin till $end, [..] is of course wrong! But what must be filled in there???
echo "Enter beginning IP-adres:"
read begin
echo "Enter ending IP-adres:"
read end
ping -c 1 $begin [..] $end
The second part is to find my own ip and ping the whole range.. How to do that? I only can find my own IP, but I cant ping the whole range,, how to do that?
#!/bin/bash
ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' |
cut -d: -f2 | awk '{ print $1 }'
View 11 Replies
View Related
May 30, 2011
I have created an xml file to change my wallpaper periodically, but when i try to select a new wallpaper..i cant find the .xml file.
View 8 Replies
View Related
Mar 16, 2011
I have this problem, that I want a specific .exe file to open in Mono, but all other .exe files to open in Wine.
However, the only option there is, are 'Select an application to open XXXX.exe and other files of type "DOS/Windows executable"'
but I just want to open THIS .exe file in mono, and the rest in WINE.
I have been in similar situations before, in that I opened a folder containing music with VLC, and it worked fine, but after that, it assumed that I wanted to open all folders in VLC.
I assume that there must be an option for this, and I can not see why it ain't an option by default.
(I'm using Ubuntu 10.10)
View 3 Replies
View Related
Apr 23, 2011
Is there any way to make the file selector dialogue box in Ubuntu show icons instead of a list or detail view? I have been trying to convince people to use Ubuntu instead of windows, but this seems to be a deal breaker for most of them. When uploading pictures to the web or facebook it is very difficult to navigate pictues in the file browser window with the little bitty thumbnails beside the file name. If there is no way to do this how would I recommend this idea for Ubuntu and to whom would I submit it?
View 4 Replies
View Related
May 31, 2011
I am trying to find a way to search a text file for a certain keyword and then select each line containing the word , copy and paste these lines into another text file. I can do this easily with UltraEdit but I cannot figure out how to do it in Jedit or Scite.
View 5 Replies
View Related
Jun 10, 2011
I cant seem to select a file on a server on my LAN to attach to a mail
View 1 Replies
View Related
Jan 23, 2009
i need a php script to format and display a select amount of text from a file or a cron job that'll do it (with grep etc) and out put to a file but whatever is easier i want to display all the banned ip's i have in my .htaccess file i have a lot of lines in my .htaccess file but i have a line that read like this:
Code:
RewriteCond %{REMOTE_ADDR} (123.123.123.123|123.123.123.123|123.123.123.123)$
the 3 test ip's are 123.123.123.123 and i want the "" stripping and the "|" removing and each ip to be on it's own line like this:
123.123.123.123
123.123.123.123
123.123.123.123
i'm not bothered if this is a php script that'll read the .htaccess file and display the output or a cron job that'll run every x mins and output it to a .txt file but i'd prefer a php script
View 14 Replies
View Related
Jul 30, 2010
I just installed Debian lenny 5.0.5 and when i start it up the monitor just displays a 'out of range' error. im using a Radeon HD 5570 graphics card and a lG W2353V-PF monitor.
what do i have to do to fix this problem?
View 2 Replies
View Related
Mar 28, 2010
the electric went off and when it come back on my monitor picture was all out of range. I changed the resolution to bring the picture back in and now the words are almost unreadable.
View 1 Replies
View Related
Apr 9, 2010
I'm trying to move files from one directory to another. I only want the files that start with a capital and within a certain range. Say all files that start with a capital between A-K. I've googled this and they all say to use: [A-M]*. But it moves all files A-M regardless if they are uppercase or lowercase.
View 7 Replies
View Related
Jun 29, 2011
I have just installed UBUNTU 11.04 and found when booting that "out of range " statement came up, after a few moments it completes the boot, but as I have several distros it doesn't open the selection screen.
View 1 Replies
View Related
Feb 24, 2010
I am having a log file where there is some discontinuous of dates are there but if i go for range of date to find the records, if is some date is missing the result is displaying full file list( Start date to end of file ) How could i restrict the result upto the mentioned date range.
Code:
$cat sample.log
Jan 03 -error yyyy-1234
[code]...
View 6 Replies
View Related
Feb 7, 2011
i have squid 2.6 installed on centos i created acl which should apply to this ip range i.e 192.168.1.10-192.168.1.15 and excluded 192.168.1.13 how can i do
View 14 Replies
View Related
Feb 13, 2010
I want to configure a VPN over the Internet.I installed the 'openvpn' package, generated the key file, transfered it by a secure way to the client, and setted up the configuration file.
So, in that configuration file I input the IP addresses of the tunneled interfaces. Both IPs are static in the tunnel.
Then, I've heard somewhere that I can assign a dynamic configuration IP for the client. I do this registering a range.
Well, when I tried to change static IP to dynamic IP (changing '192.168.0.2' to '192.168.0.0/24') in the configuration file, the OpenVPN didn't work.
Obviously I don't know what I'm doing, and I really, don't believe that simply changing the IP will make it work, but I tried.
I hope I explained my problem as well.
My configuration file:
# OpenVPN Server Configuration File
dev tun 0
ifconfig 192.168.0.1 192.168.0.2
cd /etc/openvpn
secret key_file
In client I execute the 'openvpn' without the '--daemon' parameter.Then I want that my client uses a IP in a range (192.168.0.0/24, for example), instead of a static IP (192.168.0.2).I also thought to use a DHCP server, but I'm not sure that will work.
View 6 Replies
View Related
Feb 12, 2010
For example, given the range:172.128.0.0 - 172.191.255.255I need to find some domain that resolves to an IP-adress within the range. Is it possible ? I'm using a Linux system.
View 3 Replies
View Related
Oct 4, 2010
How can I get/filter history entries in a specific range?I have a large history file and frequently usehistory | grep somecommandNow, my memory is pretty bad and I also want to see what else I did around the time I entered the command.For now I do this:get match, say 4992 somecommand, then I do history | grep 49[0-9][0-9]this is usually good enough, but I would much rather do it more precisely, that is see commands from 4972 to 5012, that is 20 commands before and 20 after. I am wondering if there is an easier way? I suspect, a custom script is in order, but perhaps someone else has done something similar before.
View 2 Replies
View Related
Mar 29, 2010
I want to know how to copy a range of files from one directory to another.
For example say I list the contents of a directory, how would i copy files 5-15 to another directory?
View 3 Replies
View Related
May 31, 2010
ls -l /tmp/empty_file*
-rw-r--r-- 1 root root 0 2010-05-30 08:00 /tmp/empty_file
-rw-r--r-- 1 root root 0 2010-05-30 12:00 /tmp/empty_file1
This looks good, the files expected to be seen are output: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -print
But this shows me files that should not be output and likewise when I replace ls with tar it is tarring a whole bunch of stuff I do not want: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -exec ls -l {} ;
In the end I would like to replace the "ls" with "tar cvvfp some.tar {} ;", but can't figure out what is going wrong here.
View 2 Replies
View Related
Aug 31, 2011
I've been working with my OpenVPN server for a while, and I have a rather interesting problem. I need to redirect all client traffic through the tunnel except for a couple IP's that need to be resolvable locally. The way I'm doing this is pushing these routes from the server:
Server 'PUSH' directives
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
I'm seeing that translating into these Windows routes:
Windows routes occurring
Wed Aug 31 15:14:35 2011 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route 10.8.0.1,topology net30,ping 5,ping-restart 30,ifconfig 10.8.0.6 10.8.0.5'
Wed Aug 31 15:14:35 2011 ROUTE default_gateway=192.168.1.254
Wed Aug 31 15:14:40 2011 C:WINDOWSsystem32
oute.exe ADD 199.[*.*.*] MASK 255.255.255.255 192.168.1.254
Wed Aug 31 15:14:40 2011 C:WINDOWSsystem32
oute.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.0.5
Wed Aug 31 15:14:40 2011 C:WINDOWSsystem32
oute.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.0.5
Wed Aug 31 15:14:40 2011 C:WINDOWSsystem32
oute.exe ADD 10.8.0.1 MASK 255.255.255.255 10.8.0.5
I've hidden my server's IP beginning with 199 for security purposes.What I've gathered.I'm assuming that 0.0.0.0 is a kind of code for "everything," so I'm not sure how I could get this to work, but the general idea is that I need a specific IP range (172.16.*) to be resolvable on the LOCAL NETWORK (of the client) meaning it does not go through the VPN tunnel and the client can connect to 172.16.* locally.Is this possible? Routes can be executed through the command line, server "push" or client config options. Any way to get this to work while still routing other traffic through would do, really.
Additional Info: I have the server running on Debian 64-bit and the client running on Windows 7 (although Vista needs to work as well).Client/server configs can be provided if needed.
View 2 Replies
View Related
Jan 18, 2010
How do I get rid of this message during boot. I have tried the system-config-kdump command but it gives me a "no command found" reply. I am using CentOS 5.4
View 1 Replies
View Related
Apr 30, 2010
I need to know all files modified within a date and time range.E.g: All modified files between 20 April 2010, 1100-1200 Hrs."find / -mtime +10 ! -mtime +11" :: this i found for date but how to include time as well.
View 2 Replies
View Related
Nov 24, 2010
I'm using centos 5.4 on an Hp Compaq 500B, 4GB ram,I have just installed centos when i try to boot the pc it says "memory for crash kernel not in permissible range, pci not using mmconfig" then it shuts down after a while.
View 1 Replies
View Related