Hi
How to pass multi line text as a command line argument to a program.
(i.e)
./a.out hi this is sample 0 file1
where
hi this is sample should be stored in argv
0 in argv and so on... (3 Replies)
Hi all,
How many arguments can we pass while testing a prgm at command line..
I encountered an issue while passing 10 arguments.
For $10 its taking argument passed for $1 followed by 'zero'.
can we pass more than 9 arguments /Is there any other way.
Thanks,
rrs (6 Replies)
--------------------------------------------------------------------------------
I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Hi,
When i am running the following script 1.sh (without giving the command line arguments) then i am getting the following error.
if
then
echo "UID and PWD are correct"
elif
then
echo "Either UID or PWD is wrong. Please check your UID and PWD"
else
echo "UID and PWD can't be blank"... (9 Replies)
I am working on a script wherein i need the user to enter the Build ID
for eg:the command line will show
enter the build ID
Now on entering the build ID it should be assigned to @ARGV.
How can this be done.? (1 Reply)
hi, can someone how to accept command line arguments as a variable using in script?
like: ./scriptname arguments
by accept arguments, I can use it in my script?
thx! (1 Reply)
hi,,,,
I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
HI ,
I am new to csh. I need to pass some command line arguments like
./abc.sh -os Linux -path abc -tl aa -PILX 1
I have defined the loop as shown below. But its taking "-os" switches as arguments. Its treating them as arguments.
How to resolve it?
while ( $#argv != 0 )
switch ($argv)
... (7 Replies)
Hi all,
I am trying to write a code for addition of n numbers which will be passed by the user as command line arguments.
I wrote the following code.
add=0
for (( i = 1 ; i <= $# ; i++ ))
do
add=`expr $i + $add`
done
#echo "sum is : $add"
input :
$./add.sh 12 32 14... (7 Replies)
Ubuntum, Bash version: 4.3.46
Hi,
how can I create a loop where the command line arguments change (increase) and every time the number of arguments is different ?
### I have many gene names... that mean gene1=$2, gene2=$3, ...... geneN=$N+1
### some time the number of gene is 25, other... (7 Replies)
Discussion started by: echo manolis
7 Replies
LEARN ABOUT OSX
encode::alias5.16
Encode::Alias(3pm) Perl Programmers Reference Guide Encode::Alias(3pm)NAME
Encode::Alias - alias definitions to encodings
SYNOPSIS
use Encode;
use Encode::Alias;
define_alias( "newName" => ENCODING);
define_alias( qr/.../ => ENCODING);
define_alias( sub { return ENCODING if ...; } );
DESCRIPTION
Allows newName to be used as an alias for ENCODING. ENCODING may be either the name of an encoding or an encoding object (as described in
Encode).
Currently the first argument to define_alias() can be specified in the following ways:
As a simple string.
As a qr// compiled regular expression, e.g.:
define_alias( qr/^iso8859-(d+)$/i => '"iso-8859-$1"' );
In this case, if ENCODING is not a reference, it is "eval"-ed in order to allow $1 etc. to be substituted. The example is one way to
alias names as used in X11 fonts to the MIME names for the iso-8859-* family. Note the double quotes inside the single quotes.
(or, you don't have to do this yourself because this example is predefined)
If you are using a regex here, you have to use the quotes as shown or it won't work. Also note that regex handling is tricky even for
the experienced. Use this feature with caution.
As a code reference, e.g.:
define_alias( sub {shift =~ /^iso8859-(d+)$/i ? "iso-8859-$1" : undef } );
The same effect as the example above in a different way. The coderef takes the alias name as an argument and returns a canonical name
on success or undef if not. Note the second argument is ignored if provided. Use this with even more caution than the regex version.
Changes in code reference aliasing
As of Encode 1.87, the older form
define_alias( sub { return /^iso8859-(d+)$/i ? "iso-8859-$1" : undef } );
no longer works.
Encode up to 1.86 internally used "local $_" to implement ths older form. But consider the code below;
use Encode;
$_ = "eeeee" ;
while (/(e)/g) {
my $utf = decode('aliased-encoding-name', $1);
print "position:",pos,"
";
}
Prior to Encode 1.86 this fails because of "local $_".
Alias overloading
You can override predefined aliases by simply applying define_alias(). The new alias is always evaluated first, and when necessary,
define_alias() flushes the internal cache to make the new definition available.
# redirect SHIFT_JIS to MS/IBM Code Page 932, which is a
# superset of SHIFT_JIS
define_alias( qr/shift.*jis$/i => '"cp932"' );
define_alias( qr/sjis$/i => '"cp932"' );
If you want to zap all predefined aliases, you can use
Encode::Alias->undef_aliases;
to do so. And
Encode::Alias->init_aliases;
gets the factory settings back.
Note that define_alias() will not be able to override the canonical name of encodings. Encodings are first looked up by canonical name
before potential aliases are tried.
SEE ALSO
Encode, Encode::Supported
perl v5.16.2 2012-10-25 Encode::Alias(3pm)