Hi
I have a log file (say log.txt). I have to search for a line which has the string ( say ERROR) in the log file and copy 15 lines after this into another file (say error.txt). Can someone give me the code and this has to be in PERL
Thanks in advance
Ammu (3 Replies)
Usually I find the answers to my beginner-script-problems here in this forum but this time I had no luck so far...:(
I want to modify a Japanese vocabulary file to import it into granule. Every line looks like this:
I would like to have it like this:
The lenght of the words always differ,... (2 Replies)
I like to know what unix command i can use to append the second line of file #1 to the end of file #2 so that it performs the following. Thanks in advance. The purpose of this is to keep track of another log file (from crontab) that i have which the log content is flushed every 5 minutes so that... (5 Replies)
I'm trying to read an xml file and copy it line by line to another file and want to preserve the tabs.
What i'm trying to do is if I get to a certain line in the xml, I'm going to check to see if the next line is specifically what I want. If it's not, then I want to insert a single line of text... (4 Replies)
Hi Guys
actually I have installed the library of qt on my desktop with the help of a blog and after the installation the following thing is written in the blog , which I didn't mean , so please help me out of it.
the code is:
Build filesystem, copy necessary Qt libraries to the filesystem... (1 Reply)
I have a file contains 100 section (here i show 2 section of that); i want to replace date from 1st & 2nd field of 1st line of each section (1st line of each section is header and the other lines are body) and merg them into one field, then copy it on 7th field of the lines in each section... (17 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Hello All,
I am looking for help to achieve the following:
Here is the data set
1757890237|42|55570025|1468796400|0
1757890237|32|55570025|1471474800|0
1757890237|54|55570025|1474153200|1476745200
1757890237|34|55570026|1468796400|0
1757890237|44|55570026|1471474800|0... (7 Replies)
Discussion started by: angshuman
7 Replies
LEARN ABOUT NETBSD
vnduncompress
VNDCOMPRESS(1) BSD General Commands Manual VNDCOMPRESS(1)NAME
vndcompress, vnduncompress -- compress/uncompress file system images to/from cloop2 format
SYNOPSIS
vndcompress [-cd] disk/fs-image compressed-image [blocksize]
vnduncompress [-cd] compressed-image disk/fs-image
DESCRIPTION
The vndcompress program compresses an existing file system image into a cloop2 compatible compressed file system image. An optional block-
size can be given. If omitted, the default of 64kB is used.
The vnduncompress command decompress a cloop2-compressed file system image back into a regular image.
The file system images that can be handled are not limited to any specific file system, i.e. it is possible to handle images e.g. in ISO 9660
or UFS/FFS format. File system images in the cloop2 format are intended to be used with the vnd(4) driver in compressed mode as configured
by the -z option of the vnconfig(8) program, and later mounted with the appropriate -t option to mount(8).
OPTIONS
The following options are available:
-c Always compress, even if the program was started as vnduncompress.
-d Always uncompress (decompress), even if the program was started as vndcompress.
EXIT STATUS
The vndcompress and vnduncompress utilities exit with one of the following values:
0 The operation was performed successfully.
1 An error occurred.
EXAMPLES
To compress an existing CD-ROM file system image, run the following commands:
# vndcompress netbsd.iso netbsd.izo
Note that the resulting compressed image cannot be mounted directly via NetBSD's vnd(4) and mount_cd9660(8) commands any longer. Instead,
you will have to use the -z option of vnconfig(8).
The following example decompresses an existing CD-ROM file system image that was compressed in the cloop2 format into a regular file that can
then be mounted:
# vnconfig vnd0 KNOPPIX.iso
# mount -t cd9660 -o ro /dev/vnd0d /mnt
# vnduncompress /mnt/KNOPPIX/KNOPPIX /var/tmp/knoppix.iso
# umount /mnt
# vnconfig -u vnd0
#
# vnconfig vnd1 /var/tmp/knoppix.iso
# mount -t cd9660 -o ro /dev/vnd1d /mnt
# ls /mnt
.rr_moved cdrom floppy lib opt sbin usr
bin dev home mnt proc sys var
boot etc initrd none root tmp vmlinuz
# umount /mnt
# vnconfig -u vnd1
As an alternative, if your vnd(4) was compiled with VND_COMPRESSION, you can use vnconfig(8) to access the cloop-compressed image directly,
e.g.,
# vnconfig vnd0 KNOPPIX.iso
# mount -t cd9660 -o ro /dev/vnd0d /mnt
# vnconfig -z vnd1 /mnt/KNOPPIX/KNOPPIX
# mount -t cd9660 -o ro /dev/vnd1d /mnt2
# ls /mnt2
.rr_moved cdrom floppy lib opt sbin usr
bin dev home mnt proc sys var
boot etc initrd none root tmp vmlinuz
# df /mnt /mnt2
Filesystem Size Used Avail Capacity Mounted on
/dev/vnd0a 692M 692M 0B 100% /mnt
/dev/vnd1a 1.9G 1.9G 0B 100% /mnt2
# umount /mnt2
# vnconfig -u vnd1
# umount /mnt
# vnconfig -u vnd0
Note how the 1.9GB big filesystem on /mnt2 is mounted from the compressed file stored on the 692MB CD mounted on /mnt. To create a com-
pressed file system image of an existing directory and mount it, run:
# makefs -t ffs include.fs /usr/include
# vndcompress include.fs include.fs.cloop2
# vnconfig -z vnd0 include.fs.cloop2
# mount -o ro /dev/vnd0a /mnt
# ls /mnt
To undo the steps, run:
# umount /mnt
# vnconfig -u vnd0
# rm /tmp/include.fs.cloop2
# rm /tmp/include.fs
SEE ALSO gzip(1), vnd(4), mount(8), mount_cd9660(8), vnconfig(8)AUTHORS
The vndcompress utility was written by Florian Stoehr <netbsd@wolfnode.de>. The vndcompress manual page was written by Florian Stoehr
<netbsd@wolfnode.de> and Hubert Feyrer <hubertf@NetBSD.org>.
BSD December 12, 2005 BSD