01-02-2011
Great, works a treat, I was playing with various quotes and escaped quotes and no joy.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am executing commands as follows in Bourne shell script. Filenames/directory names for the deletion/copying are unknown:
rm *
rmdir <directory>
cp -p * <directory>
Sometimes when no file or directory exists, error is encountered. This has no impact or whatever issue to my script but it's... (5 Replies)
Discussion started by: totziens
5 Replies
2. Shell Programming and Scripting
I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.
I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies
3. Shell Programming and Scripting
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies
4. Shell Programming and Scripting
Hello
I am having issues with a script I'm working on developing on a Solaris machine.
The script is intended to find out how many times a particular user (by given userid) has logged into the local system for more than one hour today.
Here is my while loop:
last $user | grep -v 'sshd'... (7 Replies)
Discussion started by: DaveRich
7 Replies
5. Shell Programming and Scripting
Exercise Five
Write a Bourne shell script which:
• Professionalism: plan for this from the start.
• Has one command line argument.
• If the command line argument is a directory then the script should output the number of
files in the directory.
• If the command line argument is an ordinary... (2 Replies)
Discussion started by: moesom
2 Replies
6. Shell Programming and Scripting
Hi,
Get the following error when running a shell script with following statement.
Syntax error
at line 150 : `(' is not expected
150: declare -a VPO_SEV=(Normal Warning Minor Major Critical)
it runs fine using bash, so I guess the script should be using bash but is there a... (1 Reply)
Discussion started by: wilsonee
1 Replies
7. Shell Programming and Scripting
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies
8. Shell Programming and Scripting
Hello,
I am trying to write a shell script that maintains the health of the passwd file. The goal is to check for duplicate usernames, UID's etc. I am able to find and sort out the UID and login names via awk (which I would like to use), but I can't figure out how to save the record field into a... (1 Reply)
Discussion started by: Learn4Life
1 Replies
9. Shell Programming and Scripting
I have a small program which needs to pass variable dynamically to form the name of a second variable whose value wil be passed on to a third variable.
***************** Program Start ******************
LOC1=/loc1
PAT1IN=/loc2
PAT2IN=/loc3
if ; then
for fpattern in `cat... (5 Replies)
Discussion started by: Cyril Jos
5 Replies
10. Cybersecurity
A severe vulnerability was discovered in Bourne shell.
Just google for: bash vulnerability
... for more details. (5 Replies)
Discussion started by: Cochise
5 Replies
LEARN ABOUT CENTOS
perl::critic::policy::valuesandexpressions::prohibitquotesasquot
Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotPerl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters(3)
NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters - Don't use quotes ("'", """, "`") as delimiters
for the quote-like operators.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
With the obvious exception of using single-quotes to prevent interpolation, using quotes with the quote-like operators kind of defeats the
purpose of them and produces obfuscated code, causing problems for future maintainers and their editors/IDEs.
$x = q"q"; #not ok
$x = q'q'; #not ok
$x = q`q`; #not ok
$x = qq"q"; #not ok
$x = qr"r"; #not ok
$x = qw"w"; #not ok
$x = qx`date`; #not ok
$x =~ m"m"; #not ok
$x =~ s"s"x"; #not ok
$x =~ tr"t"r"; #not ok
$x =~ y"x"y"; #not ok
$x =~ m'$x'; #ok
$x =~ s'$x'y'; #ok
$x = qr'$x'm; #ok
$x = qx'finger foo@bar'; #ok
CONFIGURATION
This policy has three options: "single_quote_allowed_operators", "double_quote_allowed_operators", and "back_quote_allowed_operators",
which control which operators are allowed to use each of "'", """, "`" as delimiters, respectively.
The values allowed for these options are a whitespace delimited selection of the "m", "q", "qq", "qr", "qw", "qx", "s", "tr", and "y"
operators.
By default, double quotes and back quotes (backticks) are not allowed as delimiters for any operators and single quotes are allowed as
delimiters for the "m", "qr", "qx", and "s" operators. These defaults are equivalent to having the following in your .perlcriticrc:
[ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters]
single_quote_allowed_operators = m s qr qx
double_quote_allowed_operators =
back_quote_allowed_operators =
SUGGESTED BY
Michael Schwern
AUTHOR
Elliot Shank "<perl@galumph.com>"
COPYRIGHT
Copyright (c) 2007-2011 Elliot Shank.
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.3 Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters(3)