Hi All,
I'm running some encrypted data through a script I wrote. In order to do this, I'm using eval to resolve some of my variables. At the moment, when I use eval to resolve, it strips out some of my encrypted values, and totally drops some others. For example if I have the value ab1"3 it drops... (1 Reply)
Bit of a weird one i suppose, i want to use an echo inside an echo... For example...
i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos...
echo "echo "hello"" >$file
echo "echo "goodbye"" >$file
... (3 Replies)
I am trying to expand the variable $user in my alias command and tried
several variations of eval but can't seem to get it to work.
The end result should be either:
oracle_user='sudo su - oracle ' or oracle_user='sudo su - oracle1 '
user=$(grep '^oracle:' /etc/passwd | cut... (5 Replies)
hi all,
Am trying to add some code to a ksh script and i dont understand how an eval function is used :
_var=$1
_conceal=$2
eval _val=\$${_var}
can someone shed some light on what the eval function in the above context means/does ??
thanks. (4 Replies)
Hi all,
some small script with eval turned me to crazy.
my OS is linux
Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux
below script works well
#!/bin/bash
eval ssh remotehost date
eval ssh remotehost ls
below... (1 Reply)
Hello All,
Since my variables are nested I use eval to populate the data.
I have an ambiguity here when eval is used along with &
say I have the below variable
url="www.unix.com" , this come from function call as argument.
I want to take this into another variable say... (6 Replies)
It always seemed to me that these utils are siblings.
All they do are that substitute values for variables, rearrange the parameters, and confuse the input with the output. :)
I tried to display their main signature in table together. To show their similarities (3 Replies)
Perl::Critic::Policy::Variables::RequireLexicalLoopIteraUser(Contributed Perl DocPerl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)NAME
Perl::Critic::Policy::Variables::RequireLexicalLoopIterators - Write "for my $element (@list) {...}" instead of "for $element (@list)
{...}".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy asks you to use "my"-style lexical loop iterator variables:
foreach my $zed (...) {
...
}
Unless you use "my", "for"/"foreach" loops use a global variable with its value "local" to the block. In other words,
foreach $zed (...) {
...
}
is more-or-less equivalent to
{
local $zed
foreach $zed (...) {
...
}
}
This may not seem like a big deal until you see code like
my $bicycle;
for $bicycle (@things_attached_to_the_bike_rack) {
if (
$bicycle->is_red()
and $bicycle->has_baseball_card_in_spokes()
and $bicycle->has_bent_kickstand()
) {
$bicycle->remove_lock();
last;
}
}
if ( $bicycle and $bicycle->is_unlocked() ) {
ride_home($bicycle);
}
which is not going to allow you to arrive in time for dinner with your family because the $bicycle outside the loop is not changed by the
loop. You may have unlocked your bicycle, but you can't remember which one it was.
Lexical loop variables were introduced in Perl 5.004. This policy does not report violations on code which explicitly specifies an earlier
version of Perl (e.g. "require 5.002;").
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
"Foreach Loops" in perlsyn
"my() in Control Structures" in perl5004delta
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-07 Perl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)