Search : in
By :

Export command in shell script?

Last answer on Jan 8, 2009 2:58:02 pm GMT vijay123, on Dec 30, 2008 8:34:54 am GMT 
 Report this message to moderators

Hello,
suppose in a program a line is there:
XYZ='/home/abc/pqr/'
;;;;;;etc

and then
what will happen if i write a command:
export XYZ


Please replay as soon as possible.
Thanks in advance.

Vijay

Configuration: Windows Vista
Internet Explorer 7.0

Best answers for « Export command in shell script? » in :
[Bash]Parameters Show[Bash]Parameters Intro Example 1 Example 2 Initialize parameters Examples Example 3 Intro You can provide a script on the command line and arguments also known as parameters for its implementation. There are two categories of...
ImageMagick - Manipulate images with command lines ShowImageMagick - Manipulate images with command lines ImageMagick is a powerful command line tool that allows you to manipulate images. The advantage of this tool is that it allows: Automate work on images (this avoids...
Phpize: command not found Showphpize: command not found If during the installation of extension pecl despite the installation of PHP, you receive below error message: sh: phpize: command not found ERROR: `phpize' failed To solve this problem under Debian, the...
Download SSH Secure Shell ShowSSH secure shell for workstations is a flexible client SSH allowing to connect in a secured way to remote applications. http://www.commentcamarche.net/faq/images/NHc6wz5jOYBhPXTis.png
UNIX system - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence its name "shell". The shell therefore acts as an intermediary between the operating system and the user using command lines...
Linux - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence the name "shell". The shell therefore acts as an intermediary between the operating system and the user thanks to command lines...
Using Telnet ShowIntroduction to Telnet Telnet is a protocol for emulating a remote terminal, which means that it can be used to run commands entered on a keyboard at a remote machine. The tool Telnet is an implementation of the Telnet protocol, which means that it...

1

kupendra, on Jan 8, 2009 7:17:10 am GMT
  • +1

The issue is that scripts run in a private subshell, and therefore don't affect the shell that called them.

If we pretend that we have a script like this:
Code:

#!/bin/bash
# Name: test_script

export OOGA=echo 'ooga'
export BOOGA=echo 'booga'

Then we can add it to the current shell by using the source command:
Code:

source test_script

Reply to kupendra

2

 raijumal, on Jan 8, 2009 2:58:02 pm GMT
  • +2

Please give your sources. Information comes from this website :
http://www.linuxforums.org/...

Reply to raijumal