Thanks MIG and Yoda!
MIG, your code is what I was looking for.
How about if I have same header for each block as "ID Length Per"?
which is the original data structure. I first struggled with RS, but could not figure out the way. Then I added the first field as the group ID.
Is it possible to use the RS to handle the original situation? Thanks!
Hi,
I have an one-line file consisting of a sequence of 660 letters. I would like to extract 9-letter blocks iteratively:
ASDFGHJKLQWERTYUIOPZXCVBNM
first block: ASDFGHJKL
1nd block: SDFGHJKLQ
What I have so far only gives me the first block, can anyone please explain why?
cat... (7 Replies)
Hi,
I have file which contains information written in blocks (every block is different). Is it possible to read every block one by one to another file (one block per file).
The input is something like this
<block1>
<empty line>
<block2>
<empty line>
...
...
...
<block25>
<empty... (0 Replies)
I have a file like the one below. Each record is separated with >
In between I have lines consisting of 3 numeric values separated by a space.
I need to take each block between the > sign and read the first number in the line.
Then take the first after the > sign and the last before the >... (7 Replies)
Hello,
I am trying to create a shell script that use command block (donīt really know if this is the correct way to say it), but while one version works fine, the other one is not working at all.
So let me show an example of this "command block" Iīm using and its working ok:
cat << _EOF_
`echo... (7 Replies)
I'm Unix. I'm looking at "df" on Unix now and below is an example. It's lists the filesystems out in 512-blocks, I need this in 4k blocks. Is there a way to do this in Unix or do I manually convert and how?
So for container 1 there is 7,340,032 in size in 512-blocks. What would the 4k block be... (2 Replies)
Hello,
I have a file like this:
FILE.TXT:
(define argc :: int)
(assert ( > argc 1))
(assert ( = argc 1))
<check>
#
(define c :: float)
(assert ( > c 0))
(assert ( = c 0))
<check>
#
now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
I have 2 duplicate blocks in an inode and I want to get rid of one of them so that I can get into my pc. The message I get is Multiply-claimed block(s) in inode 5997500: 12690101 12690101. All help is appreciated. Thanks (7 Replies)
please help, I have a huge file with blocks of data which I need to convert to a tabular format.
Input
sample
id: GO:0000017
name: alpha-glucoside transport
namespace: biological_process
def: "The directed movement of alpha-glucosides into, out of or within a cell, or between... (3 Replies)
Discussion started by: ritakadm
3 Replies
LEARN ABOUT SUNOS
scsi_hba_pkt_alloc
scsi_hba_pkt_alloc(9F) Kernel Functions for Drivers scsi_hba_pkt_alloc(9F)NAME
scsi_hba_pkt_alloc, scsi_hba_pkt_free - allocate and free a scsi_pkt structure
SYNOPSIS
#include <sys/scsi/scsi.h>
struct scsi_pkt *scsi_hba_pkt_alloc(dev_info_t *dip, struct scsi_address *ap, int cmdlen, int statuslen, int tgtlen, int hbalen, int
(*callback, caddr_t arg, caddr_t arg);
void scsi_hba_pkt_free(struct scsi_address *ap, struct scsi_pkt *pkt);
INTERFACE LEVEL
Solaris architecture specific (Solaris DDI).
PARAMETERS
dip Pointer to a dev_info_t structure, defining the HBA driver instance.
ap Pointer to a scsi_address(9S) structure, defining the target instance.
cmdlen Length in bytes to be allocated for the SCSI command descriptor block (CDB).
statuslen Length in bytes to be allocated for the SCSI status completion block (SCB).
tgtlen Length in bytes to be allocated for a private data area for the target driver's exclusive use.
hbalen Length in bytes to be allocated for a private data area for the HBA driver's exclusive use.
callback Indicates what scsi_hba_pkt_alloc() should do when resources are not available:
NULL_FUNC
Do not wait for resources. Return a NULL pointer.
SLEEP_FUNC
Wait indefinitely for resources.
arg Must be NULL.
pkt A pointer to a scsi_pkt(9S) structure.
DESCRIPTION
For scsi_hba_pkt_alloc():
scsi_hba_pkt_alloc() allocates space for a scsi_pkt structure. HBA drivers must use this interface when allocating a scsi_pkt from their
tran_init_pkt(9E) entry point.
If callback is NULL_FUNC, scsi_hba_pkt_alloc() may not sleep when allocating resources, and callers should be prepared to deal with allo-
cation failures.
scsi_hba_pkt_alloc() copies the scsi_address(9S) structure pointed to by ap to the pkt_address field in the scsi_pkt(9S).
scsi_hba_pkt_alloc() also allocates memory for these scsi_pkt(9S) data areas, and sets these fields to point to the allocated memory:
pkt_ha_private HBA private data area.
pkt_private Target driver private data area.
pkt_scbp SCSI status completion block.
pkt_cdbp SCSI command descriptor block.
For scsi_hba_pkt_free():
scsi_hba_pkt_free() frees the space allocated for the scsi_pkt(9S) structure.
RETURN VALUES
scsi_hba_pkt_alloc() returns a pointer to the scsi_pkt structure, or NULL if no space is available.
CONTEXT
scsi_hba_pkt_alloc() can be called from user or interrupt context. Drivers must not allow scsi_hba_pkt_alloc() to sleep if called from an
interrupt routine.
scsi_hba_pkt_free() can be called from user or interrupt context.
SEE ALSO tran_init_pkt(9E), scsi_address(9S), scsi_pkt(9S)
Writing Device Drivers
SunOS 5.10 24 Feb 2003 scsi_hba_pkt_alloc(9F)