08-19-2010
Did you do anything with $PATH variable in this script?
9 More Discussions You Might Find Interesting
1. Programming
Hello, I am a basic programer from back in the 80's/90's. I moved on to visual basic and now I want to learn C. I want to eventually program in Linux.
Now, before I get on this band wagon I want to ask a few questions to make sure I am getting started out right.
1. Is C a good language to... (2 Replies)
Discussion started by: wizkid
2 Replies
2. Shell Programming and Scripting
Hi, everybody.
I just wonder whether there are a couple of free Linux servers running as terminals where people can practice Unix Shell Programming?
I'd like to set up one myself but unfortunatly can't do it. I can't switch to Linux now coz I run a couple of servers on my machine.
Cygwin is... (3 Replies)
Discussion started by: belgampaul
3 Replies
3. Programming
can you guys please let me know what are some of the c programming environment program? you know the ones with checking syntax and auto indentation and such..
dont want to just use vi (although someone did mention to me that in vim, there are capabilities.. but not sure how)
thanks in advance. (6 Replies)
Discussion started by: convenientstore
6 Replies
4. Linux
Hi friends!
I am new be in Linux system programing. Can you help me to get running processes statistics (pid, uid, %cpu, %mem, pri, ni) without using any commands like TOP, PS.
Can you tell me any system call available to get %cpu only or %mem only?
Even i include... (2 Replies)
Discussion started by: venkatgopu
2 Replies
5. Linux
Hi friends
In my linux application, i want to update output in same place i.e..
I want to display my output in specific location in screen(console output)
ITERATION 1:
(e.g. start diplay from 5th ROW 5th COLOUMN)
if my message is "hi" then
first time
'h' should print in 5th ROW... (2 Replies)
Discussion started by: venkatgopu
2 Replies
6. UNIX for Dummies Questions & Answers
Hello.
I like Linux and C programming language. Allways wanted to understand kernel and become a Linux system programmer. And I also like Objective-C and iOS. These two programming areas have relations:
1. Linux and iOS are UNIX-like systems, POSIX compliant.
2. It is useful to know C language... (2 Replies)
Discussion started by: Rockatansky
2 Replies
7. UNIX for Dummies Questions & Answers
sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
8. Shell Programming and Scripting
Hi All,
can any one help me on this please.
Replace sting in FILE1.txt with FILE2.txt. FILE1.txt record must have at least one state is repeated once.But need to replace only from second occurrence in record in FILE1.txt
Condition: order of searching the records in FILE2.txt is impartent.... (8 Replies)
Discussion started by: ureddy
8 Replies
9. Red Hat
Develop a program to display file given on the command line to STDOUT, please give sample program (2 Replies)
Discussion started by: ainstin
2 Replies
Env(3pm) Perl Programmers Reference Guide Env(3pm)
NAME
Env - perl module that imports environment variables as scalars or arrays
SYNOPSIS
use Env;
use Env qw(PATH HOME TERM);
use Env qw($SHELL @LD_LIBRARY_PATH);
DESCRIPTION
Perl maintains environment variables in a special hash named %ENV. For when this access method is inconvenient, the Perl module "Env"
allows environment variables to be treated as scalar or array variables.
The "Env::import()" function ties environment variables with suitable names to global Perl variables with the same names. By default it
ties all existing environment variables ("keys %ENV") to scalars. If the "import" function receives arguments, it takes them to be a list
of variables to tie; it's okay if they don't yet exist. The scalar type prefix '$' is inferred for any element of this list not prefixed by
'$' or '@'. Arrays are implemented in terms of "split" and "join", using $Config::Config{path_sep} as the delimiter.
After an environment variable is tied, merely use it like a normal variable. You may access its value
@path = split(/:/, $PATH);
print join("
", @LD_LIBRARY_PATH), "
";
or modify it
$PATH .= ":.";
push @LD_LIBRARY_PATH, $dir;
however you'd like. Bear in mind, however, that each access to a tied array variable requires splitting the environment variable's string
anew.
The code:
use Env qw(@PATH);
push @PATH, '.';
is equivalent to:
use Env qw(PATH);
$PATH .= ":.";
except that if $ENV{PATH} started out empty, the second approach leaves it with the (odd) value "":."", but the first approach leaves it
with ""."".
To remove a tied environment variable from the environment, assign it the undefined value
undef $PATH;
undef @LD_LIBRARY_PATH;
LIMITATIONS
On VMS systems, arrays tied to environment variables are read-only. Attempting to change anything will cause a warning.
AUTHOR
Chip Salzenberg <chip@fin.uucp> and Gregor N. Purdy <gregor@focusresearch.com>
perl v5.12.5 2012-11-03 Env(3pm)