Even though you said you cannot control the controlling process, but actually it is that process that has made an incorrect assumption that parameters need not be quoted, but the fact is special characters are treated specially by the shell.
For instance, the bash manpage has this:
Quote:
There are three quoting mechanisms: the escape character, single quotes, and double quotes.
A non-quoted backslash (\) is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>. If a \<newline> pair appears, and the backslash is not itself quoted, the \<newline> is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).
Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, \, and, when history expansion is enabled, !. The characters $ and ` retain their special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: $, `, " , \, or <newline>. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an ! appearing in double quotes is escaped using a backslash. The backslash preceding the ! is not removed.
So you have no option but to teach the process that generates the command to quote the parameters or escape the offending characters (\ $ etc.), because the backslashes have already been gone by the time they reach Perl. Perl has no way of getting them back!
Hello All,
I am a newbie in Shell script programming, and maybe you can help me with my query.
I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script.
The mntServer.ksh script contains:
#!/bin/ksh... (1 Reply)
Hi Everyone,
# cat a.txt
a;b;c;64O
a;b;c;d;ee;f
# cat a.pl
#!/usr/bin/perl
use strict;
use warnings;
my $tmp3 = ",,a,,b,,c,,d,,e,,f,,";
open(my $FA, "a.txt") or die "$!";
while(<$FA>) {
chomp;
my @tmp=split(/\;/, $_);
if ( ($tmp =~ m/^(64O)/i) || ($tmp... (3 Replies)
Hi everyone,
I`ll try to be most clear I can explaining my help request.
I have 2 folders
Folder A-->This folder receives files through FTP constantly
Folder B-->The files from Folder A are unzipped and then processed in Folder B
Sometimes Folder A doesn`t contain all... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi, how can I get the mv command to include files beginning with . (such as .htaccess)?
Right now when I mv a directory the .htaccess file is missing and I need to do this on a lot of directories, so there's a lot of wordpress permalinks that don't work anymore because the .htaccess file wasn't... (5 Replies)
i have two files
t4.txt
para1
para2
t5.txt
34
56
after compiling the following in perl
system("paste t4.txt t5.txt > table.txt");
i am getting o/p as
para1 34
para2 56
but i need o/p as
para1,34
para2,56 (3 Replies)
please help!!!!!!
I have a file .txt that has only one column like that:
34.1
35.5
35.6
45.6
...
Now, i want to add a column in the left in which the values of this column increase by 0.4 , for example:
0.0 34.1
0.4 35.5
0.8 35.6
1.2 45.6
How can i do with awk instructions??? ... (2 Replies)
Hi.
I've had a little mishap.
To cut a long story short, I've accidentally recursively ran chown on a directory (actually a bunch of 'em). Not a problem in itself, but I had a slight error in the code I used to get the list of directories and ended up with a comment in the file ownership.
... (15 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
ncc::countrycode
CountryCode(3pm) User Contributed Perl Documentation CountryCode(3pm)NAME
NCC::CountryCode - Perl extension for blah blah blah
SYNOPSIS
use NCC::CountryCode;
my $cc = new NCC::CountryCode();
my $cc_hash = $cc->getCCs();
print ($cc->isCC('NL')) ? "exists" : "non-existing";
$cc->CC2Country('fr');
$cc->Country2CC('russia');
DESCRIPTION
This module provides class and several methods to simplify mapping between country names and country codes, as they assigned in the
ISO3166.
The CC2Country() method maps country code to the corresponding country name or empty string, if it doesn't exist.
The Country2CC() tries to map passed country name into country code. As the spelling of the name may vary, this function tries to find all
possible matches for passed name. In array context method returns hash of country codes and names, in scalar - a string, containing all
possible country codes and corresponding country names.
The isCC() method verifies, that passed country code is a legal one and returns it in upper case. Otherwise it returns empty string.
The getCCs() method returns the reference to the internal hash, that containes all the country codes with corresponding them country names.
BUGS
In addition to the country codes defined by ISO3166 standart this module also introduce 'UK' as a synonim for 'GB' and 'EU' as additional
'virtual' name for the Europe itself.
AUTHOR
Timur Bakeyev, timur@ripe.net
SEE ALSO perl(1).
perl v5.10.1 2001-09-10 CountryCode(3pm)