>\root\sandeep\log111.txt
>This files has a lot of text and one particulr line is .....
>##Date 24-07-2001
>
>Now
>1. I need to locate the line "##Date" in the above file
>2. I then need to store the date value "24-07.2001" in a variable.
Which language you are using? I assume Perl, because this is much simpler in
Perl.
1. Open the file for reading.
2. Search for the above string by reading every line. $_ variable
contains the current line. You can do this by using pattern searching
operations in Perl.
3. Once you find the above line then split that line at spaces and collect
the required date in a variable.
Here is the code which I would prefer to write.
open(RH,"</root/sandeep/log111.txt");
while(<RH>)
{
if($_ =~ /##Date/)
{
$flag = 1;
}
else
{
$flag = 0;
}
if($flag eq 1)
{
($str1, $str2) = split(/ /, $_);
$date = $str2;
}
}
Hope this is very much clear.
Regards,
Mayur
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Here's the situation:
Net DSL Windowsbox LAN(dhcp) Linuxbox
The LAN, naturally, has a 192.168.0.0 range of IPs (I think it's a
class C). The DSL modem is connected to the Winbox on USB and the LAN
is a 5-port hub supporting a windows network, with my Linux box (say
hello to gort, folks) creeping in using dhcpd.
The Linux box, and any box on the LAN, can access everything. I think
the Net cannot access anything but the Windows box on the DSL modem
(see <http://gort.cjb.net/>. That's the Winbox.).
Now I need POP3 (and HTTP et al, if possible) access to the Linux box
from the outside world. IP forwarding is enabled on the Winbox.
What do I do now?
PS: Can I get a static IP on the internal network with minimal changes
to the other boxen?
--
Satya. <URL:http://satya.virtualave.net/>
US-bound grad students! For pre-apps, see <URL:http://quickapps.cjb.net/>
I recently installed Nautilus on my Debian woody system ... but it
seems to be missing a few pieces. It cannot render html pages on its
own. Clicking on Help->User Manual, the html source of the page gets
displayed instead of being renderred correctly.
Here are the error messages that Nautilus keeps throwing up:
** WARNING **: Can't find description even for "x-directory/normal".
This probably means that your gnome-vfs.keys file is in the wrong place
or isn't being found for some other reason.
** WARNING **: No description found for mime type "text/html" (file is
"/"), please tell the gnome-vfs mailing list.
And similar warnings for other mime types ...
I checked for /usr/share/mime-info/gnome-vfs.keys and it is in the
right place. Since I am using Debian, I am pretty sure that apt has
taken care of all dependencies ...
What could have gone wrong???
SameerDS.
=====
--
MTech Student
Reconfigurable Computing Lab
KReSIT, IIT-Bombay
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
I want to know how I can block telnet access to my machine
_when_a_specified_condition_is_true_.
I have a lot of people telnetting to my m/c (in office) and then
they run some heavy processes. As per the rules and
requirements of the project, I'm not supposed to block telnet
access completely. But under certain circumstances, I can block
telnet access. The "certain circumstances" can be a set of
rules. For example, if load average (w|head -1|cut -f3 -d,) is
greater than some limit, or if the amount of free memory
(free|tail -1|tr -s ' '|cut -f4 -d' ') falls below some limit,
or something like that.
I'm clueless, so... please help.
Manish
--
Abandon the search for Truth; settle for a good fantasy.
Some time ago, Philip had posted a list of guidelines about posting to
a mailing list ...
Where can I find it? I don't know what phrase to search for ...
SameerDS.
=====
--
MTech Student
Reconfigurable Computing Lab
KReSIT, IIT-Bombay
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
hi
this is about a kernel mechanism...
a process executes in 'user mode' normally.
When it makes a system call it switches to 'kernel mode'.
Now in 'user mode' it only as access to the process related data structures
and in 'kernel mode',it can do anything.
My Question is "Have I got everything right?"
and secondly....do some processors have 'execution modes'?
If so please give me some pointers to further information in that direction?
thanks
abhijeet
I was trying to load a new OS.
I had linux partitions in hda5 and hda7.
After the OS loaded, i tried to run linux rescue from pcq linux 7.1 (linux CD from PCQ which I use as my OS).
I could not rescue using standard method.
Next Itried to upgrade it and I found that I could not upgrade and was getting this error
An error occured reading the partition table for the block device hda. The error has logical partition of type 0 detected.
then there was some such explainatory mesage.
On saying Ok, it skipped the disk.
Then i loaded another hard disk and I can now see that the hard disk shows hda4 which has size equal to the addition of sizes of hda5 and hda7.
but it does not show hda5 and 7 in brackets.
How do i retrieve my old data. there is almost twenty days of un backed up data or rather data backed up on hda7.
Any clues to this problems solution?
Anand
Hello People
A friend of mine is going to attend a Model United
Nations (in which Highschool age students from several
countries are chosen as representatives of a nation to
the Model U.N) meet in Harvard and their topic is
going to be Solutions to Cybercrime.
I know the topic couldn't get more cliched and that
there is no absolute solution as such but can u people
give some ideas on how various nations can come up
with something tangible as far as tackling cybercrime
on an international level is concerned.
There are several tricky areas like a German court
(or was it French) recently instructed yahoo to stop
showing Neo Nazi auctionables in their search and
Yahoo got an injunction against that from a US court.
Sorry if this is way O.T, just that you guys are the
few people I know who can give ideas on this.
Thanks
Aarjav
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
hi there,
this is OT. but please dont flame, its a last resort i
am using.
we were planning ot make a automated land going
vehicle using stepper motors from the dot matrix
printers. and belts etc. it would run on the parallel
port.
could anyone be in the capacity to donote these
printers ? actually only the steppers and belts are
needed !
Please send a mail to rahulsaxon(a)yahoo.com if u can
help !
thanks for reading.
-rahul
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
hi
does anybody on the list have a staroffice cd???
i know its up there on the site...but i don't have a very
good connection and can't download it...
i would appreciate if somebody could write it for me???
is the StarOffice suite on the DIGIT cd for linux???
Somebody pl. tell me about this so that i could buy the mag.
ciao
abhijeet