Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
... (7 Replies)
hi all,
Can any 1 help me translate this korn shell code to C shell code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
In config_2.txt the content is :
which mean in korn shell , $1=groupname and $2=email address.
Now i need to write in C shell script,when i set the... (2 Replies)
Hi,
I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory.
finally {
if (null != hibernateSession && hibernateSession.isOpen()) {
//hibernateSession.close();
}
}
It would be great if the script has... (2 Replies)
Hi ,
I have a code where i am using a infinite while loop . some thing like below
while
do
if
then
#go to line 20
fi
command 1;
command 2;
#line 20:
sleep 34; (5 Replies)
Discussion started by: Paarth
5 Replies
LEARN ABOUT MOJAVE
getline
GETLINE(3) BSD Library Functions Manual GETLINE(3)NAME
getdelim, getline -- get a line from a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
ssize_t
getdelim(char ** restrict linep, size_t * restrict linecapp, int delimiter, FILE * restrict stream);
ssize_t
getline(char ** restrict linep, size_t * restrict linecapp, FILE * restrict stream);
DESCRIPTION
The getdelim() function reads a line from stream, delimited by the character delimiter. The getline() function is equivalent to getdelim()
with the newline character as the delimiter. The delimiter character is included as part of the line, unless the end of the file is reached.
The caller may provide a pointer to a malloced buffer for the line in *linep, and the capacity of that buffer in *linecapp. These functions
expand the buffer as needed, as if via realloc(). If linep points to a NULL pointer, a new buffer will be allocated. In either case, *linep
and *linecapp will be updated accordingly.
RETURN VALUES
The getdelim() and getline() functions return the number of characters written, excluding the terminating NUL character. The value -1 is
returned if an error occurs, or if end-of-file is reached.
EXAMPLES
The following code fragment reads lines from a file and writes them to standard output. The fwrite() function is used in case the line con-
tains embedded NUL characters.
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, fp)) > 0)
fwrite(line, linelen, 1, stdout);
ERRORS
These functions may fail if:
[EINVAL] Either linep or linecapp is NULL.
[EOVERFLOW] No delimiter was found in the first SSIZE_MAX characters.
These functions may also fail due to any of the errors specified for fgets() and malloc().
SEE ALSO fgetln(3), fgets(3), malloc(3)STANDARDS
The getdelim() and getline() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').
HISTORY
These routines first appeared in FreeBSD 8.0.
BUGS
There are no wide character versions of getdelim() or getline().
BSD November 30, 2010 BSD