I have a script that I'm trying to shorten (below) by removing repetitive code.
if ]
then
commodity_ndm_done=Y
fi
if ]
then
customer_ndm_done=Y
fi
if ]
then
department_ndm_done=Y
fi
if ]
then
division_ndm_done=Y
fi (3 Replies)
Hello,
FIRST QUESTION:
I am writing a script in which a query is taken at the beginning of the script to be later used at the end. In the query, variables are generated from a loop, and I would like to assign the variable NAME (not value) with an appended 1, 2, 3, 4.....n. The number of... (2 Replies)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
I need to define a variable of variable. I'll try to explain it.
I've a list:
LIST="aaa bbb ccc"I need to do something like:
for word in LIST ;do
res_$word=`ls $word`
done
This doesn't work. Any idea?
Thanks (3 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
Below are three variables, which I want to pass into variable RESULT1
username1=userid
poihostname1=dellsys.com
port1=8080
How can I pass these variables into below code...
RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Perl::Critic::Policy::ValuesAndExpressions::RequireInterUsertContribPerl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars(3)NAME
Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars - Warns that you might have used single quotes when you really
wanted double-quotes.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy warns you if you use single-quotes or "q//" with a string that has unescaped metacharacters that may need interpolation. Its
hard to know for sure if a string really should be interpolated without looking into the symbol table. This policy just makes an educated
guess by looking for metacharacters and sigils which usually indicate that the string should be interpolated.
Exceptions
o Variable names to "use vars":
use vars '$x'; # ok
use vars ('$y', '$z'); # ok
use vars qw< $a $b >; # ok
o Things that look like e-mail addresses:
print 'john@foo.com'; # ok
$address = 'suzy.bar@baz.net'; # ok
CONFIGURATION
The "rcs_keywords" option allows you to stop this policy from complaining about things that look like RCS variables, for example, in
deriving values for $VERSION variables.
For example, if you've got code like
our ($VERSION) = (q<$Revision: 4126 $> =~ m/(d+)/mx);
You can specify
[ValuesAndExpressions::RequireInterpolationOfMetachars]
rcs_keywords = Revision
in your .perlcriticrc to provide an exemption.
NOTES
Perl's own "warnings" pragma also warns you about this.
SEE ALSO
Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolationOfLiterals
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.16.3Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars(3)