04-05-2011
Hello, 2002anand:
What's the point of all this? What are you trying to accomplish?
Regards,
Alister
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
I have a file that has lines with different lengts. I want this file to be filled up with a zero so that al the lines have the same length.
Please advice?
File 1:
-----------
2310
2009
830
1345
Result
File 2:
----------
2310
2009
0830 (3 Replies)
Discussion started by: peterk
3 Replies
2. Shell Programming and Scripting
Hi ....
we are having the below file .Column 1, Column 2 ,column 3 are key fields...
In the below ...for 2 nd , 3 rd row the repeated key column is missing ....
i want the new file to be populated with all missing key columns.
... (11 Replies)
Discussion started by: charandevu
11 Replies
3. Shell Programming and Scripting
It can't be that hard, but I just can't figure it out:
I have file like:
File Sub-brick M_1 S_1 M_2 S_2 M_4 S_4 ...
xxx 1 214 731 228 621 132 578 ...
and would like to get 0 0 where M_3 S_3 is missing
xxx 1 214 731 228 621 0 0 132 578 ...
I wrote following script, but can't figure out... (3 Replies)
Discussion started by: avvk
3 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
Got a question to make a script what reads a directory and put the file names from that directory in a file with some extra text.
ls /tempdir
output is:
file1.gfh
file2.txt
file4.zzz
these file names (always with an extention) must be placed in a line and written to... (2 Replies)
Discussion started by: ToXiQ
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I've got a file with several columns where some entries are missing.
Example:
a b c d
f g h
j k l
p y r
I need to replace the empty spaces with zero, so the new file would be:
a b c d
f 0 g h
j k 0 l
p y 0 r
The original file is tab delimited.
Many thansk for... (3 Replies)
Discussion started by: zajtat
3 Replies
6. Programming
Hi everyone, I am using shell scripting on a Unix SCO box. It calls a C program named zerofill. I do not know anything about C. I am having an issue with a hash total that should only be zero filled 10 positions but the record has 11 positions.
DEBUG RESULTS
+ nice -n -5 bc -l /tmp/fhash8395... (0 Replies)
Discussion started by: ski
0 Replies
7. Shell Programming and Scripting
How do I zero fill a string. E.g pad a string to two digits
m=`date "+%m"`
pm=`expr $m - 1`
echo $pm
the above code echoes 1. I want it to echo 01. Any ideas? (3 Replies)
Discussion started by: timgolding
3 Replies
8. UNIX for Dummies Questions & Answers
hi all! i have a script with an output like this
abc 123 1246
abc 1386
abc 2589
abc 7383
what can i do if i want to fill the 2nd column with the 2nd string '123'
abc 123 1246
abc 123 1386
abc 123 2589
abc 123 7383
thanks! (3 Replies)
Discussion started by: engr.jay
3 Replies
9. Shell Programming and Scripting
Hi All,
I have 100 .txt files which look like this:
3
4
5
6
7
Now, some files have some numbers missing in them and they look like this:
4
5
6 (6 Replies)
Discussion started by: shoaibjameel123
6 Replies
10. Shell Programming and Scripting
Hi,
I have a data sample as shown below. I want to fill in the left column so that the line will be continuous. For example, between 1 and 5 should be 2,3,4. And corresponding values in the right column will be 0. Thus the expected data should look like that:
1 1
1 10
1 2
1 3
1 5
1 6
2 0... (6 Replies)
Discussion started by: theanh0508
6 Replies
awrite(9E) Driver Entry Points awrite(9E)
NAME
awrite - asynchronous write to a device
SYNOPSIS
#include <sys/uio.h>
#include <sys/aio_req.h>
#include <sys/cred.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
intprefixawrite(dev_t dev, struct aio_req *aio_reqp, cred_t *cred_p);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). This entry point is optional. Drivers that do not support an awrite() entry point should use
nodev(9F)
PARAMETERS
dev Device number.
aio_reqp Pointer to the aio_req(9S) structure that describes where the data is stored.
cred_p Pointer to the credential structure.
DESCRIPTION
The driver's awrite() routine is called to perform an asynchronous write. getminor(9F) can be used to access the minor number component of
the dev argument. awrite() may use the credential structure pointed to by cred_p to check for superuser access by calling drv_priv(9F).
The awrite() routine may also examine the uio(9S) structure through the aio_req structure pointer, aio_reqp. awrite() must call
aphysio(9F) with the aio_req pointer and a pointer to the driver's strategy(9E) routine.
No fields of the uio(9S) structure pointed to by aio_req, other than uio_offset or uio_loffset, may be modified for non-seekable devices.
RETURN VALUES
The awrite() routine should return 0 for success, or the appropriate error number.
CONTEXT
This function is called from user context only.
EXAMPLES
Example 1: Using the awrite routine:
The following is an example of an awrite() routine:
static int
xxawrite(dev_t dev, struct aio_req *aio, cred_t *cred_p)
{
int instance;
struct xxstate *xsp;
instance = getminor(dev);
xsp = ddi_get_soft_state(statep, instance);
/*Verify soft state structure has been allocated */
if (xsp == NULL)
return (ENXIO);
return (aphysio(xxstrategy, anocancel, dev, B_WRITE, xxminphys, aio));
}
SEE ALSO
write(2), aiowrite(3AIO), aread(9E), read(9E), strategy(9E), write(9E), anocancel(9F), aphysio(9F), ddi_get_soft_state(9F), drv_priv(9F),
getminor(9F), minphys(9F), nodev(9F), aio_req(9S), cb_ops(9S), uio(9S)
Writing Device Drivers
BUGS
There is no way other than calling aphysio(9F) to accomplish an asynchronous write.
SunOS 5.10 28 Mar 1997 awrite(9E)