10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have a file called text.txt contains
x
y
z
when i run a command i will get output like below
x 20
z 30
i want to insert x, z value in text.txt file and should be like this
x 20
y 0
z 30
can anyone help me please? (1 Reply)
Discussion started by: siva kumar
1 Replies
2. Shell Programming and Scripting
I am familiar with scripting, but I am trying to see if there is an easy way to append files from similar files into one file. For example, if there is file1_20121201, file1_20121202, file1_20121203,
file2_20121201, file2_20121202, file2_20121203
I want to be able to combine all the data from... (3 Replies)
Discussion started by: mrbean1975
3 Replies
3. Shell Programming and Scripting
I have searched the forms and I can not find info on appending each line of one file to the same line of another file. I know that I can cat one file to another or append the 2nd file to the end of the 1st but not quite sure how to append one line of data to another. For example
File 1 has ... (2 Replies)
Discussion started by: scw132
2 Replies
4. AIX
Dear all experts,
I have a LTO3 tape drive and thinking of upgrade to LTO4 drive.
Before we proceed to upgrade, I have 1 question to ask.
As I will use the backup tape to restore into other server (pSeries p550), I have the problem of if I backup in LTO4 tape in future, how can I restore the... (1 Reply)
Discussion started by: kwliew999
1 Replies
5. Shell Programming and Scripting
I have on file abc.txt
abc.txt:
20090807
Now I want to delete empty lines which has tap/whit spaces from abc.txt .and store the date value in the file into variable.some processs will update the this file with some date . if the process updtes thiis file with empty string , write the... (3 Replies)
Discussion started by: Gopal_Engg
3 Replies
6. Shell Programming and Scripting
Hi,
I would like to know if it's possible to append data into a variable, rather than into a file. Although I can write information into a temporary file in /tmp, I'd rather if possible write into a variable, as I don't like the idea that should my script fail, I'll be polluting the server with... (5 Replies)
Discussion started by: michaeltravisuk
5 Replies
7. Shell Programming and Scripting
Hi.
I wrote a very simple script and it doesn't work :(
It is supposed to go to a certain directory, execute some command and append the output to the file "expo.dat"
what it does is that it writes to the file only one entery. I dont know if Im using the write synthax for "append". Here is... (3 Replies)
Discussion started by: Enigma08
3 Replies
8. AIX
Hi, I am using AIX 5.3.0.0 and Ultrium LTO3 Tape Drive as rmt1. I have backup some of my database file using command "pax" as
pax -wvf /dev/rmt1 "./data01/abc.dmp"
But when I tried to read the file from tape by issuing the command,
pax -vf /dev/rmt1
The error message displayed as
pax:... (4 Replies)
Discussion started by: kwliew999
4 Replies
9. Shell Programming and Scripting
Hi,
Am trying to write a shell script which will append a header and a footer to an existing file. Header will contain details like the current date while the footer will contain the no: of records listed in the file.
I know we can use the CAT command, but i have no clue abt the syntax to... (4 Replies)
Discussion started by: brainstormer
4 Replies
10. UNIX for Dummies Questions & Answers
I need to know how to record the hostname, date/time and all of the process and send it all to one file. I know that the commands I need are hostname, date and ps but I don't know how to do them all and send them all to the same file. Please help! (1 Reply)
Discussion started by: precious51980
1 Replies
MTIO(4) BSD Kernel Interfaces Manual MTIO(4)
NAME
mtio -- generic magnetic tape I/O interface
SYNOPSIS
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/mtio.h>
DESCRIPTION
Magnetic tape has been the computer system backup and data transfer medium of choice for decades, because it has historically been cheaper in
cost per bit stored, and the formats have been designed for portability and storage. However, tape drives have generally been the slowest
mass storage devices attached to any computer system.
Magnetic tape comes in a wide variety of formats, from classic 9-track, through various Quarter Inch Cartridge (QIC) variants, to more modern
systems using 8mm video tape, and Digital Audio Tape (DAT). There have also been a variety of proprietary tape systems, including DECtape,
and IBM 3480.
UNIX TAPE I/O
Regardless of the specific characteristics of the particular tape transport mechanism (tape drive), UNIX tape I/O has two interfaces: "block"
and "raw". I/O through the block interface of a tape device is similar to I/O through the block special device for a disk driver: the indi-
vidual read(2) and write(2) calls can be done in any amount of bytes, but all data is buffered through the system buffer cache, and I/O to
the device is done in 1024 byte sized blocks. This limitation is sufficiently restrictive that the block interface to tape devices is rarely
used.
The "raw" interface differs in that all I/O can be done in arbitrary sized blocks, within the limitations for the specific device and device
driver, and all I/O is synchronous. This is the most flexible interface, but since there is very little that is handled automatically by the
kernel, user programs must implement specific magnetic tape handling routines, which puts the onus of correctness on the application program-
mer.
DEVICE NAME CONVENTIONS
Each magnetic tape subsystem has a couple of special devices associated with it.
The block device is usually named for the driver, e.g. /dev/st0 for unit zero of a st(4) SCSI tape drive.
The raw device name is the block device name with an "r" prepended, e.g. /dev/rst0.
By default, the tape driver will rewind the tape drive when the device is closed. To make it possible for multiple program invocations to
sequentially write multiple files on the same tape, a "no rewind on close" device is provided, denoted by the letter "n" prepended to the
name of the device, e.g. /dev/nst0, /dev/nrst0.
The mt(1) command can be used to explicitly rewind, or otherwise position a tape at a particular point with the no-rewind device.
FILE MARK HANDLING
Two end-of-file (EOF) markers mark the end of a tape (EOT), and one end-of-file marker marks the end of a tape file.
By default, the tape driver will write two End Of File (EOF) marks and rewind the tape when the device is closed after the last write.
If the tape is not to be rewound it is positioned with the head in between the two tape marks, where the next write will over write the sec-
ond end-of-file marker.
All of the magnetic tape devices may be manipulated with the mt(1) command.
A number of ioctl(2) operations are available on raw magnetic tape. Please see <sys/mtio.h> for their definitions.
The manual pages for specific tape device drivers should list their particular capabilities and limitations.
SEE ALSO
dd(1), mt(1), pax(1), tar(1), st(4), wt(4)
HISTORY
The mtio manual appeared in 4.2BSD.
BUGS
The status should be returned in a device independent format.
If and when NetBSD is updated to deal with non-512 byte per sector disk media through the system buffer cache, perhaps a more sane tape
interface can be implemented.
BSD
January 14, 1999 BSD