01-21-2008
Hi Vino,
Thanks
Yes . I have done that in a shell script.
The below script got executed successfuly
i have the following in 1.sh
export var1=/<>/<>/<>
export var2=/<>/<>/<>
./2.sh
And i have the following in 2.sh
echo $var1
when i run 1.sh i get the echo run
But wat i wanted was
vi 1.sh
export var1=/<>/<>/<>
export var2=/<>/<>/<>
after i run the above script if i give aecho of var1 then it sholud give me the dir path
But this doesnot work.
It looks like the exporting is available to only the subscripts and once we come out of 1.sh(in the secondcase) the effect of export is lost .
Thanks in advance
10 More Discussions You Might Find Interesting
1. Programming
I load some dynamic libraries from main module (with dlopen). These libraries use 1 function from main module, therefore in Makefile I must use
gcc -g -Wl,--export-dynamic,-rpath,./lib -o not not.o db.o -ldl -ldb -lpcap
Note option --export-dynamic that is passed to the ELF linker.
The... (4 Replies)
Discussion started by: Hitori
4 Replies
2. Shell Programming and Scripting
export only last two fields?
here is my test file, with variable length of fields, each line is composed of letter only, and each line has at least 2 fields, fields were separated by dot (.)
abcd.abc.mlm
dft.dfasdf.bmk.kdjlka
ksdfalksdjfsl.tyu.ml
kasdjf.asdfkja.asdfj.asdf.df.m
lja.ml... (4 Replies)
Discussion started by: fedora
4 Replies
3. UNIX for Dummies Questions & Answers
hi, :)
I created a main script called "Paymain.prg" ( /proj/paymain.prg)
In this script i created two variables as follows
MASTER=/HOME/emaster.dbf
TRAN=/HOME/etran.dbf
Aftre that i exported that two variables
EXPORT MASTER TRAN
But when i use these two variable in another script calld... (3 Replies)
Discussion started by: ravi raj kumar
3 Replies
4. Shell Programming and Scripting
I am trying to export the variable OBJ2 and set it to done. Can some one please let me how to do this?
I have tried editing my .bashrc file with this echo <VARIABLE_NAME>=<"OBJ2"> But that wont seem to work... (1 Reply)
Discussion started by: Justinkase
1 Replies
5. Shell Programming and Scripting
Hi all,
I am calling a script from main script.
The called script (second script) have to return some value, i can use exit to pass but in exit i have to pass some other value.
i used "export Var", but this command resides in a function of second script.
could you please tell me how to... (3 Replies)
Discussion started by: Arunprasad
3 Replies
6. Shell Programming and Scripting
Hello,
I have the following command at the "Shell":
export PATH=${PATH}:${ANT_HOME}/bin
I know what "export" does and the ANT_HOME part. But, regarding the following part:
${PATH}
What is "PATH" Supposed to be here. In other words, what is the value of "PATH".
As far as for... (4 Replies)
Discussion started by: SWEngineer
4 Replies
7. Shell Programming and Scripting
Hi
I have a pass a variable from one script to another.
Here are my scripts
Script #1 ./profile
#!/bin/sh
export NAME="Hello"
Script #2 ./test
#!/bin/sh
./profile
echo $NAME
when I run ./test .. i am not getting anything .. why is that? (5 Replies)
Discussion started by: arex876
5 Replies
8. Shell Programming and Scripting
Hi Experts ,
Does anybody know the sheel scripts , which exports oracle tables into xls files .
Thanks for your feedback.
Regards
Pranav (1 Reply)
Discussion started by: Heisonline
1 Replies
9. AIX
Hi
How to export a file system from my aix box named ABC in such a way that everyone on the network should be able to import it
When on the client side if they give showmount -e ABC it should show like this:
# showmount -e ABC
export list for ABC:
/sybase/software (everyone) (2 Replies)
Discussion started by: newtoaixos
2 Replies
10. Ubuntu
Hello,
I'm trying to use export for non use "./" when I execute a program.
I mean "program" in place of "./program"
I tried this:
export doit=program
But doesn't work the answer is:
doit command not found
Then, I see the variables using export, and I can see:
... (1 Reply)
Discussion started by: NewBe
1 Replies
LEARN ABOUT CENTOS
stapdyn
STAPDYN(8) System Manager's Manual STAPDYN(8)
NAME
stapdyn - systemtap dyninst runtime
SYNOPSIS
stapdyn [ OPTIONS ] MODULE [ MODULE-OPTIONS ]
DESCRIPTION
The stapdyn program is the dyninst back-end of the Systemtap tool. It expects a shared library produced by the front-end stap tool, when
run with --dyninst.
Splitting the systemtap tool into a front-end and a back-end allows a user to compile a systemtap script on a development machine that has
the debugging information (need to compile the script) and then transfer the resulting shared objevct to a production machine that doesn't
have any development tools or debugging information installed.
Please refer to stappaths(7) for the version number, or run rpm -q systemtap (fedora/red hat) apt-get -v systemtap (ubuntu)
OPTIONS
The stapdyn program supports the following options. Any other option prints a list of supported options.
-v Verbose mode.
-V Print version number and exit.
-w Suppress warnings from the script.
-c CMD Command CMD will be run and the stapdyn program will exit when CMD does. The '_stp_target' variable will contain the pid for CMD.
-x PID The '_stp_target' variable will be set to PID.
-o FILE
Send output to FILE. If the module uses bulk mode, the output will be in percpu files FILE_x(FILE_cpux in background and bulk mode)
where 'x' is the cpu number. This supports strftime(3) formats for FILE.
-C WHEN
Control coloring of error messages. WHEN must be either "never", "always", or "auto" (i.e. enable only if at a terminal). If the op-
tion is missing, then "auto" is assumed. Colors can be modified using the SYSTEMTAP_COLORS environment variable. See the stap(1)
manual page for more information on syntax and behaviour.
var1=val
Sets the value of global variable var1 to val. Global variables contained within a script are treated as options and can be set from
the stapdyn command line.
ARGUMENTS
MODULE is either a module path or a module name. If it is a module name, the module will be looked for in the following directory (where
'VERSION' is the output of "uname -r"):
/lib/modules/VERSION/systemtap
$ stap --dyninst -p4 -m mod1 -e 'global var1="foo"; probe begin{printf("%s
", var1); exit()}'
Running this with an additional module argument:
$ stapdyn mod1.so var1="HelloWorld"
HelloWorld
Spaces and exclamation marks currently cannot be passed into global variables this way.
EXAMPLES
See the stapex(3stap) manual page for a collection of sample scripts.
Here is a very basic example of how to use stapdyn. First, use stap to compile a script. The stap program will report the pathname to the
resulting module.
$ stap --dyninst -p4 -e 'probe begin { printf("Hello World!
"); exit() }'
/home/user/.systemtap/cache/85/stap_8553d83f78c_265.so
Run stapdyn with the pathname to the module as an argument.
$ stapdyn /home/user/.systemtap/cache/85/stap_8553d83f78c_265.so
Hello World!
SAFETY AND SECURITY
Systemtap, in DynInst mode, is a developer tool, and runs completely unprivileged. The Linux kernel will only permit one's own processes
to be accessed, which is enforced by the ptrace(2) system call. See the stap(1) manual page for additional information on safety and secu-
rity.
SEE ALSO
stap(1), stapprobes(3stap), stap-server(8), staprun(8), stapex(3stap)
BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sourceware.org/systemtap/, <systemtap@sourceware.org>.
STAPDYN(8)