hi
I wanted to access the C program variables in shell script.
This script is called from the same C program.
What are the ways in which i can access variables
thankx (3 Replies)
Hello,
I wonder if it is possible to pass and use variables from shell environment into sed or awk. I am trying to achieve something similar to the following using sed or awk:
var=some_regular_expression
grep "$var" filename # Will extract lines from filename
The following code,... (3 Replies)
I have a variable $exe in a shell script file a.sh which I need to access in another shell script file b.sh. How can I do that? :rolleyes:
Thanks!! (2 Replies)
Hi,
I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB... (2 Replies)
Hello All,
I was just wondering if there is any direct way to access PL/SQL OUT variables from Korn Shell Script.
I could already figure out how to return a single value back from PL/SQL to Shell Script (using bind variable).
But, what if we want to return multiple values?
One option I... (4 Replies)
Hi All,
I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh.
For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access... (2 Replies)
Hi,
I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program).
#!/usr/bin/sh
j=10
k=1
#k is declared outside awk
awk '
BEGIN {
i=1;
j1="'"$j"'"
printf("\n ## Value of j1 is %d ##", j1);
... (2 Replies)
Hello,
So I have approximately 300 files of raw data (.txt) files that I am using to perform statistical analysis. I have been able to construct a Fortran program that is able to perform my statistical analysis on a file by file basis.
However, I now want to be able to loop program through... (19 Replies)
how to store the count of queries in variables inside a filein shell script
my output :
filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
. (3 Replies)
Hi,
Can anyone explain this please..... This is on AIX with GDB (tried a few versions). It only happens when program compiled in 64 bit and only with static variables....
A simple test program...
### snip
#include <stdio.h>
main() {
static int n;
n = 6;
printf("hello %d\n", n);... (0 Replies)
Discussion started by: bagpussnz
0 Replies
LEARN ABOUT LINUX
getenv
GETENV(3) Linux Programmer's Manual GETENV(3)NAME
getenv - get an environment variable
SYNOPSIS
#include <stdlib.h>
char *getenv(const char *name);
DESCRIPTION
The getenv() function searches the environment list to find the environment variable name, and returns a pointer to the corresponding value
string.
RETURN VALUE
The getenv() function returns a pointer to the value in the environment, or NULL if there is no match.
CONFORMING TO
SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
NOTES
The strings in the environment list are of the form name=value.
As typically implemented, getenv() returns a pointer to a string within the environment list. The caller must take care not to modify this
string, since that would change the environment of the process.
The implementation of getenv() is not required to be reentrant. The string pointed to by the return value of getenv() may be statically
allocated, and can be modified by a subsequent call to getenv(), putenv(3), setenv(3), or unsetenv(3).
SEE ALSO clearenv(3), putenv(3), setenv(3), unsetenv(3), environ(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-03-17 GETENV(3)