Sponsored Content
Full Discussion: set environment variable?
Top Forums UNIX for Advanced & Expert Users set environment variable? Post 93728 by xnightcrawl on Wednesday 21st of December 2005 03:28:59 PM
Old 12-21-2005
/etc/profile is the system wide variable. you can edit this file or do it from the command prompt.

example:

bourne shell:
set
VARIABLE=blah blah blah

korn shell (ksh):
export VARIABLE=blah blah blah
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How does the PATH and MANPATH environment variable get set?

Hi, How does the PATH and MANPATH environment variable get set? I want to add "/opt/SUNWspro/bin" to the search path for all the users. Where can I access this variable. I know in my home directory, depend on which shell I use, there are files such as .profile and .cshrc which I can edit to... (3 Replies)
Discussion started by: vtran4270
3 Replies

2. UNIX for Advanced & Expert Users

how to set the environment variable at run time

hi, I have one environment variable like path in my system.But in my program i need to change that path .suppose it has a value "config" now i need to chage it as "config1" or something else.i need to use that variable for complete project.It means at first it will use the old path but after... (4 Replies)
Discussion started by: sada@123
4 Replies

3. Shell Programming and Scripting

Help to set the oracle environment????

Hi, I am trying to set the environment for my oracle database. I have 5 database in an unix box. My idea is to create 5 files for each database with the following script on it. After logging into the unix box ...just by typing the database name....the enviornment for the database... (2 Replies)
Discussion started by: castlerock
2 Replies

4. Shell Programming and Scripting

problem in getting the path of environment variable set in bashrc in my shell script

hi all i have joined new to the group. i have set an variable in my bashrc file. .bashrc PROGHOME=/home/braf/braf/prog export PROGHOME but while using it in my shell script its path is not taken and i had to explicitly give the export command to set the path. in my script... (8 Replies)
Discussion started by: krithika
8 Replies

5. Linux

How do i set environment variable

Hi, I am quite new to Linux. And I have doubt how to set new environment variable with value to a C executable. Let say I have a environment variable $Hack ; I would like to load a value for this variable; so that when the C executable is executed, the $Hack would set the variable value. ... (4 Replies)
Discussion started by: ahjiefreak
4 Replies

6. Solaris

set environment variable?

I am working with solaris 9 sunBlade150 Box. I Installed a program, need to set the environment variable so that when the executable is entered,it finds the path to the executable. The documentation for the software says: Set the appropriate environment variable: Connect to server failed;... (8 Replies)
Discussion started by: smartgupta
8 Replies

7. UNIX for Dummies Questions & Answers

ORACLE_HOME environment variable not set!

hi, i am new to perl: os : Linux i wrote simple perl script to select from table i am getting this error and how to set ORACLE_HOME environment variable : script: #!usr/bin/perl use DBI; use Mail::Sendmail; #use Date::Calc; use MIME::QuotedPrint; use HTML::Entities; use POSIX... (2 Replies)
Discussion started by: prakash.gr
2 Replies

8. Shell Programming and Scripting

Set environment

Hi, I can run shell script from the command line using $ . set If the run the script inside perl script using $var = system("set"); print $var; This prints 0. This command sets up the environment from command line. But when used inside the shell script or perl script it... (2 Replies)
Discussion started by: sandy1028
2 Replies

9. Shell Programming and Scripting

Set Environment variable from another file

Hi, i have the following env variable. currently i am exporting variable in the same script file. but i need this is in a text file and the scripts need to export this variable from the text file. can you please suggest me. is it possible. export... (6 Replies)
Discussion started by: rsivasan
6 Replies

10. Solaris

How to search for the sessions that have a certain environment variable set?

Hi all, In Solaris 10, is there a way to search for the sessions that have a certain environment variable set? (8 Replies)
Discussion started by: ejianu
8 Replies
File::Which(3pm)					User Contributed Perl Documentation					  File::Which(3pm)

NAME
File::Which - Portable implementation of the `which' utility SYNOPSIS
use File::Which; # exports which() use File::Which qw(which where); # exports which() and where() my $exe_path = which('perldoc'); my @paths = where('perl'); - Or - my @paths = which('perl'); # an array forces search for all of them DESCRIPTION
"File::Which" was created to be able to get the paths to executable programs on systems under which the `which' program wasn't implemented in the shell. "File::Which" searches the directories of the user's "PATH" (as returned by "File::Spec->path()"), looking for executable files having the name specified as a parameter to "which()". Under Win32 systems, which do not have a notion of directly executable files, but uses special extensions such as ".exe" and ".bat" to identify them, "File::Which" takes extra steps to assure that you will find the correct file (so for example, you might be searching for "perl", it'll try perl.exe, perl.bat, etc.) Steps Used on Win32, DOS, OS2 and VMS Windows NT Windows NT has a special environment variable called "PATHEXT", which is used by the shell to look for executable files. Usually, it will contain a list in the form ".EXE;.BAT;.COM;.JS;.VBS" etc. If "File::Which" finds such an environment variable, it parses the list and uses it as the different extensions. Windows 9x and other ancient Win/DOS/OS2 This set of operating systems don't have the "PATHEXT" variable, and usually you will find executable files there with the extensions ".exe", ".bat" and (less likely) ".com". "File::Which" uses this hardcoded list if it's running under Win32 but does not find a "PATHEXT" variable. VMS Same case as Windows 9x: uses ".exe" and ".com" (in that order). Functions which($short_exe_name) Exported by default. $short_exe_name is the name used in the shell to call the program (for example, "perl"). If it finds an executable with the name you specified, "which()" will return the absolute path leading to this executable (for example, /usr/bin/perl or C:PerlBinperl.exe). If it does not find the executable, it returns "undef". If "which()" is called in list context, it will return all the matches. where($short_exe_name) Not exported by default. Same as "which($short_exe_name)" in array context. Same as the `where' utility, will return an array containing all the path names matching $short_exe_name. BUGS AND CAVEATS
Not tested on VMS or MacOS, although there is platform specific code for those. Anyone who haves a second would be very kind to send me a report of how it went. File::Spec adds the current directory to the front of PATH if on Win32, VMS or MacOS. I have no knowledge of those so don't know if the current directory is searced first or not. Could someone please tell me? SUPPORT
Bugs should be reported via the CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Which <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Which> For other issues, contact the maintainer. AUTHOR
Adam Kennedy <adamk@cpan.org> Per Einar Ellefsen <pereinar@cpan.org> Originated in modperl-2.0/lib/Apache/Build.pm. Changed for use in DocSet (for the mod_perl site) and Win32-awareness by me, with slight modifications by Stas Bekman, then extracted to create "File::Which". Version 0.04 had some significant platform-related changes, taken from the Perl Power Tools `which' implementation by Abigail with enhancements from Peter Prymmer. See <http://www.perl.com/language/ppt/src/which/index.html> for more information. COPYRIGHT
Copyright 2002 Per Einar Ellefsen. Some parts copyright 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
File::Spec, which(1), Perl Power Tools: <http://www.perl.com/language/ppt/index.html>. perl v5.14.2 2009-09-26 File::Which(3pm)
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy