08-18-2011
When you execute it as ./setUP, a child shell is invoked first and them the setUP script is invoked in the child shell. So the var_name is set in that (child) shell and is available to it and its children - not its parent.
By invoking it as . ./setUP, you are asking the shell to execute the script in the current shell. Hence, var_name is visible to your current shell.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi friends,
i'm new to unix and straight away i had to start with the script files.
I've a script file which gets called from a menu item on a GUI.
This script file again calls .awk file, in performing some tasks , which also generates certain files.
I modified the files to generate some... (1 Reply)
Discussion started by: Ravi_Kandula
1 Replies
2. Shell Programming and Scripting
Hello Friends,
I have bash script on unix server which i want to call from windows server. Basically i want a command line which will call this script on unix server. Any one has any idea regarding this?
Help really appreciated!!
Thanks,
Roshni. (1 Reply)
Discussion started by: onlyroshni
1 Replies
3. Shell Programming and Scripting
Hi,
I have a query ..
i have 2 scripts say 1.sh and 2.sh
1.sh contains many functions written using shell scripts.
2.sh is a script which needs to call the functions definded in 1.sh
function calls are with arguments.
Can some one tell me how to call the functions from 2.sh?
Thanks in... (6 Replies)
Discussion started by: jisha
6 Replies
4. Shell Programming and Scripting
Hi there,
I have an script reading content of a file and runs whatever command is specified there, as follows
#!/bin/bash
# Supposed to read from a file that commands are listed to be run
# when the server starts for initialization
CMD_FILE=/myScripts/startup/task2do.txt
if ; then
... (2 Replies)
Discussion started by: james gordon
2 Replies
5. Shell Programming and Scripting
Hello gurus,
I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script.
i m looking for something like this
call 3.1;
If 3.1 = "complete" then
call 3.2;
if 3.2 = ''COMPlete" then
call 3.3;
else
exit
The... (1 Reply)
Discussion started by: shashi369
1 Replies
6. Shell Programming and Scripting
Hello - I have a small diff script that checks 2 directories. It reports the difference in count such as wc -l, and also names the different files.
How should I get "ERROR: diff found . (host)" - when it actually finds a diff?
This is how I have written:
#!/bin/bash
... (10 Replies)
Discussion started by: DallasT
10 Replies
7. Shell Programming and Scripting
Hi all ,
i am trying to calculate time difference btw the script execution
I am using solaris
start_time=`date +%s`
sleep 2
end_time=`date +%s`
duration=`expr $end_time - $start_time`
when i try to subtract i get the error
line 13: %s - -time : syntax error: operand expected... (3 Replies)
Discussion started by: posner
3 Replies
8. Shell Programming and Scripting
Hi ALL
I have a shell script named setUP in which i am sourcing one variable like
source var_name="CLASSPATH".
When i call it as ./setUP, it does not set the var_name variable. But when i call it like . ./setUP then var_name is set up. What is the difference between this two calls?
... (2 Replies)
Discussion started by: SasDutta
2 Replies
9. Shell Programming and Scripting
Hi,
I am new to shell scripting.
please help me to find out the solution.
I need a script where we need to read the text file(consists of all file names) and get the file names one by one
and append the date suffix for each file name as 'yyyymmdd' .
Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies
10. Shell Programming and Scripting
Can someone let me know how could I achieve this
In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Discussion started by: anuragpgtgerman
5 Replies
LEARN ABOUT HPUX
xtcreatepob
XtCreatePopupShell() XtCreatePopupShell()
Name
XtCreatePopupShell - create a popup shell widget.
Synopsis
Widget XtCreatePopupShell(name, widget_class, parent, args, num_args)
String name;
WidgetClass widget_class;
Widget parent;
ArgList args;
Cardinal num_args;
Inputs
name Specifies the resource name for the created shell widget.
widget_class
Specifies the widget class pointer for the created shell widget; must be shellClass or any subclass.
parent Specifies the parent widget; must be of class Core or any subclass thereof.
args Specifies the argument list to override the resource defaults.
num_args Specifies the number of arguments in the argument list.
Returns
A widget of class widget_class created as a popup child of parent.
Description
XtCreatePopupShell() checks that widget_class is a subclass of Shell, and, if it is, creates a widget of that class. The widget is not
stored in the children array (maintained by Composite widgets), but rather in the popup_list array (which all widgets have).
The screen resource for this widget is determined by first scanning args for the XtNscreen resource. If it is not found, the resource
database associated with the parent's screen is queried. If both queries fail, the parent's screen is used. Once the screen is deter-
mined, the resource database associated with that screen is used to retrieve all remaining resources for the widget not specified in args.
Usage
All shell widgets other than those created by XtAppInitialize() and XtAppCreateShell() must be created with XtCreatePopupShell(). Popup
shells can be a child of any widget, not just Composite widgets. Remember that shell widgets can only have a single child, which will gen-
erally be the layout widget that arranges whatever grandchildren widgets are to appear in the popup.
Creating and realizing a popup shell widget is not enough to make it visible. To make a shell pop up, use XtPopup() or one of the prede-
fined callback procedures or menu actions that call this function. To make it popdown, call XtPopdown().
Rather than initializing an ArgList to pass to XtCreatePopupShell(), you can call XtVaCreatePopupShell() which accepts a NULL-terminated
variable length argument list of resource names and resource values.
See Also
XtCallbackExclusive(1), XtMenuPopup(1), XtPopdown(1), XtPopup(1), XtVaCreatePopupShell(1).
Xt - Pop Ups XtCreatePopupShell()