07-21-2006
[QUOTE=blowtorch]What's wrong with jim's answer? Did you try to do it and did it fail?
No wrong with Jims answer . i know it ll work.
i am working on a server where in i have functions ,they are put through some other way .basically i am lookin for the other way around.
i tried FPATH is also working.but donno how to do it using ENV files.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a function or script like this.
show()
{
echo "Hi"
} | tee -a log
show
This creates a logfile and prints Hi in it. Now when I try to do the same for sql like this:
show()
{
sqlplus -s scott/tiger<<!
select * from details;
!
} | tee -a log
show
Then it gives me a... (2 Replies)
Discussion started by: sendhilmani
2 Replies
2. Shell Programming and Scripting
Hi
my shell is tcsh
can I have functions in my shell scripting?
Is the below shell script correct.
Can I have two functions and call one of them as required.
----------
echo "functions"
f1
f1 ()
{ echo "hello" }
f2 () (1 Reply)
Discussion started by: amitrajvarma
1 Replies
3. Programming
Is it not a healthy practice to mix C and C++ standard I/O functions together
e.g.
string name; // this is a declared instance of the string class in C++
printf("\nPlease enter your name: ");
cin >> name;
I did something similar in a program Im designing, and used it several... (1 Reply)
Discussion started by: JamesGoh
1 Replies
4. Shell Programming and Scripting
I have korn shells where I want to create a function passing $1 to a function , determine my $STAT_ENV value, set the paths and return
the paths for STATSH,STATPRM,STATSQR,STATSQL,STATCTL TO BE USED IN THE UNIX SCRIPT THE CALLED THE fucnction in the first place.
Can someone tell me the best... (2 Replies)
Discussion started by: TimHortons
2 Replies
5. Shell Programming and Scripting
I'm semi new to unix/linux and am trying to convert a program I wrote in C++ to a bash script. It's a program that prints Fibonacci's series. I have found scripts that will do it, but I'm trying persistently to get this one to work. The problem occurs when I try to return a value from the function.... (3 Replies)
Discussion started by: Glowworm
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am exploring with defining functions in my BASH shell scripts. However, I am bit confused about how to pass parameters to my functions. I was under the impression that you must do something like the following:
Define a function called "sample_function":
function sample_function {... (3 Replies)
Discussion started by: msb65
3 Replies
7. Shell Programming and Scripting
Hi, im making a little script but need some help
Code i have so far is
read -p 'Bot Nickname:' ecnick
read -p 'Bot Username:' ecusername
read -p 'Bot Realname:' ecrealname
read -p 'Your Email:' ecemail
echo ''
echo Your bots nickname is set to $ecnick
echo Your bots username is set to... (2 Replies)
Discussion started by: Gemster
2 Replies
8. UNIX for Dummies Questions & Answers
Hey I have a question....
what is the difference between using == vs -eq when testing in WHILE loops.
I use the following test that only worked with == signs....
if
why do i need == and not -eq?
2. I need to re-use some code in a couple places in this script. is functions my best... (5 Replies)
Discussion started by: danieldcc
5 Replies
9. Programming
Hi All,
Can any one help me.
I am calling in a function2 with string as parameter from function1, the function1 gives 3 values. how i get the 3 values from funciton2 to function1. i have to give a return or something.
thanks in advance. (2 Replies)
Discussion started by: uday.sena.m
2 Replies
10. Shell Programming and Scripting
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
Discussion started by: saku
8 Replies
LEARN ABOUT SUSE
posix_mem_offset
POSIX_MEM_OFFSET(3P) POSIX Programmer's Manual POSIX_MEM_OFFSET(3P)
PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAME
posix_mem_offset - find offset and length of a mapped typed memory block (ADVANCED REALTIME)
SYNOPSIS
#include <sys/mman.h>
int posix_mem_offset(const void *restrict addr, size_t len,
off_t *restrict off, size_t *restrict contig_len,
int *restrict fildes);
DESCRIPTION
The posix_mem_offset() function shall return in the variable pointed to by off a value that identifies the offset (or location), within a
memory object, of the memory block currently mapped at addr. The function shall return in the variable pointed to by fildes, the descriptor
used (via mmap()) to establish the mapping which contains addr. If that descriptor was closed since the mapping was established, the
returned value of fildes shall be -1. The len argument specifies the length of the block of the memory object the user wishes the offset
for; upon return, the value pointed to by contig_len shall equal either len, or the length of the largest contiguous block of the memory
object that is currently mapped to the calling process starting at addr, whichever is smaller.
If the memory object mapped at addr is a typed memory object, then if the off and contig_len values obtained by calling posix_mem_offset()
are used in a call to mmap() with a file descriptor that refers to the same memory pool as fildes (either through the same port or through
a different port), and that was opened with neither the POSIX_TYPED_MEM_ALLOCATE nor the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag, the typed
memory area that is mapped shall be exactly the same area that was mapped at addr in the address space of the process that called
posix_mem_offset().
If the memory object specified by fildes is not a typed memory object, then the behavior of this function is implementation-defined.
RETURN VALUE
Upon successful completion, the posix_mem_offset() function shall return zero; otherwise, the corresponding error status value shall be
returned.
ERRORS
The posix_mem_offset() function shall fail if:
EACCES The process has not mapped a memory object supported by this function at the given address addr.
This function shall not return an error code of [EINTR].
The following sections are informative.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
mmap(), posix_typed_mem_open(), the Base Definitions volume of IEEE Std 1003.1-2001, <sys/mman.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE
and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained
online at http://www.opengroup.org/unix/online.html .
IEEE
/The Open Group 2003 POSIX_MEM_OFFSET(3P)