Hi,
I need to check whether one file has EOF or not.
There's one daemon in our system, which will pick the files FTPed to us. However, sometimes the daemon picks the file before FTP is finished.
So I'm planning to add some checking of EOF on the FTPed files in the shell script.
Could... (8 Replies)
Guys, Im trying to have a script that evaluates multiple conditions :
test.sh:
if
then
echo "host $1"
else
if
then
echo "host $1"
else
echo $1 not valid
exit 1
fi
when I do
./test.sh brazil1
I get: (4 Replies)
if -o ]
then
echo "Expected valid value"
The above multiple if condition is NOT working in my script.
I am getting the error as '-a' not expected. Can anyone help with the syntax for this? (5 Replies)
Hi All,
I am new to shell scripting.
Can any one say what is wrong in this if statement, that uses multiple conditions
if
then
***************
else
if ( -z $pcs && "$night_time_calc" > "$night_time" )
then
********************************
... (4 Replies)
Hi folks
I m creating script which is give me below error.
$ ./function.ksh
./function.ksh: here document `EOF' unclosed
Inside the script is
#!/bin/ksh
export ORACLE_SID=OECDV1
export ORACLE_HOME=/u01/app/oracle/product/10.2.0
export PATH=$ORACLE_HOME/bin:$PATH
echo "sql is... (3 Replies)
I am needing to include some if statements within an expect script. These will need to have two conditions under an AND join. Upon a successful IF condition I want to set multiple variables.
I have tried a lot of variations of the below statement with no success. I have also searched the WEB... (2 Replies)
I have written this script. This is used for creating a backup folder.
#!/bin/sh
#set -x
. /home/.profile
usage="Usage is $0"
usage="$usage "
# Use the getopt utility to set up the command line flags.
set -- `/usr/bin/getopt b: $*`
# Process individual command line arguments
while ;... (1 Reply)
Hi Guys,
I am new to shell script.I need your help to write a shell script.
I need to write a shell script to extract data from a .csv file where columns are ',' separated.
The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (1 Reply)
Hi All,
I am trying to place one SQL query in Shell Script with Where Condition as Status='1' But after running the the script it is returning error as
SQL0206N "1" is not valid in the context where it is used. SQLSTATE=42703
The query is working fine in Data Base.
Please suggest... (1 Reply)
I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block? (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
LEARN ABOUT SUSE
biodone
biodone(9F) Kernel Functions for Drivers biodone(9F)NAME
biodone - release buffer after buffer I/O transfer and notify blocked threads
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
void biodone(struct buf *bp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
bp Pointer to a buf(9S) structure.
DESCRIPTION
biodone() notifies blocked processes waiting for the I/O to complete, sets the B_DONE flag in the b_flags field of the buf(9S) structure,
and releases the buffer if the I/O is asynchronous. biodone() is called by either the driver interrupt or strategy(9E) routines when a buf-
fer I/O request is complete.
biodone() provides the capability to call a completion routine if bp describes a kernel buffer. The address of the routine is specified in
the b_iodone field of the buf(9S) structure.
If such a routine is specified, biodone() calls it and returns without performing any other actions. Otherwise, it performs the steps
above.
CONTEXT
biodone() can be called from user or interrupt context.
EXAMPLES
Generally, the first validation test performed by any block device strategy(9E) routine is a check for an end-of-file (EOF) condition. The
strategy(9E) routine is responsible for determining an EOF condition when the device is accessed directly. If a read(2) request is made
for one block beyond the limits of the device (line 10), it will report an EOF condition. Otherwise, if the request is outside the limits
of the device, the routine will report an error condition.
In either case, report the I/O operation as complete (line 27).
1 #define RAMDNBLK 1000 /* Number of blocks in RAM disk */
2 #define RAMDBSIZ 512 /* Number of bytes per block */
3 char ramdblks[RAMDNBLK][RAMDBSIZ]; /* Array containing RAM disk */
4
5 static int
6 ramdstrategy(struct buf *bp)
7 {
8 daddr_t blkno = bp->b_blkno; /* get block number */
9
10 if ((blkno < 0) || (blkno >= RAMDNBLK)) {
11 /*
12 * If requested block is outside RAM disk
13 * limits, test for EOF which could result
14 * from a direct (physio) request.
15 */
16 if ((blkno == RAMDNBLK) && (bp->b_flags & B_READ)) {
17 /*
18 * If read is for block beyond RAM disk
19 * limits, mark EOF condition.
20 */
21 bp->b_resid = bp->b_bcount; /* compute return value */
22
23 } else { /* I/O attempt is beyond */
24 bp->b_error = ENXIO; /* limits of RAM disk */
25 bp->b_flags |= B_ERROR; /* return error */
26 }
27 biodone(bp); /* mark I/O complete (B_DONE) */
28 /*
29 * Wake any processes awaiting this I/O
30 * or release buffer for asynchronous
31 * (B_ASYNC) request.
32 */
33 return(0);
34 }
...
SEE ALSO read(2), strategy(9E), biowait(9F), ddi_add_intr(9F), delay(9F), timeout(9F), untimeout(9F), buf(9S)
Writing Device Drivers
WARNINGS
After calling biodone(), bp is no longer available to be referred to by the driver. If the driver makes any reference to bp after calling
biodone(), a panic may result.
NOTES
Drivers that use the b_iodone field of the buf(9S) structure to specify a substitute completion routine should save the value of b_iodone
before changing it, and then restore the old value before calling biodone() to release the buffer.
SunOS 5.10 23 Apr 1996 biodone(9F)