2. Rule 7a for the first word, in some cases refers to Rule 7b, which is labeled "not the first word". Is that a misleading label ?
No. Consider the following: you have an executable called "foo=bar", which is a valid name for a file. What would these lines do:
Would it assign the value "bar" to a variable "foo" or would it execute the command foo=bar?
Quote:
Originally Posted by Mark_Galeck
3. The yacc symbol cmd_word refers to rule 7b, which says, if the word contains '=' after its first character, then it is an assignment - and not anything to do with a command. Should rule 7b simply state that it is not allowed to have '=' after the first character?
4. Rule 7a is only referenced during parsing simple commands, which cannot have any reserved words in them. Yet Rule 7a in some cases refers to Rule 1, which differentiates between a reserved word and ordinary word.
And all this deals with similar situations. That may seem pretty picky, but when designing a language you cannot assume that one only uses things that make sense at first glance.
There are 2 shell script files sh1 and sh2.
sh2 contains records such as 01 02 03 on different lines.
In sh1, I would like to read each record of sh2 till end of file, concatenate them with a comma(,) and store in a variable.
Can somebody please help me with the sh1 script?
Thanks in... (2 Replies)
There are 2 shell script files sh1 and sh2.
sh2 contains records such as 01 02 03 on different lines.
In sh1, I would like to read each record of sh2 till end of file, concatenate them with a comma(,) and store in a variable.
Can somebody please help me with the sh1 script?
Thanks in... (6 Replies)
I've just written a test harness using ksh.
One of scripts weighed in at 1206 lines.
I came across Eric Raymonds 'Art of Unix programming' on line and he advises against excessively large scripts.
I am very interested to hear people's opinions on this and any experiences they have had. (2 Replies)
I just setup a new jumpstart server, and I'm having problems with rules.ok errors.
I'm coming up blank after many Google searches, forum searches, etc.....
This is the error I receive:
Skipped interface e1000g1
Attempting to configure interface e1000g0...
Configured interface e1000g0... (0 Replies)
Hello,
I am new on PHP scripting .I have shell scripts which I an running currently from linux server but now I want to make a web portal from where I will run all my scripts but the problem is all my scripts ask for parameters so I am getting confused how could I run my shell script from web... (2 Replies)
Hi,
I am trying to check if two input files exist before the rest of the scripts is run. Following is the code that I have but it gives me syntax error.
if
then
echo "File not found"
else
echo "File found"
fi (3 Replies)
Hi all...
This is more of a concensus question than help...
As many of you know I am experimenting with the limitations of Pure POSIX shell scripting.
Q: Is the directory /bin considered part of the Pure POSIX shell or must I stick entirely with the builtins only?
The reason is I... (2 Replies)
Hi all,
I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic.
I have downloaded and use the shellcheck program on Linux.
This programs says:
In POSIX sh, 'let' is undefined.
See the screenshot attached.
What is the POSIX... (1 Reply)
Discussion started by: johnprogrammer
1 Replies
LEARN ABOUT DEBIAN
mojo::parameters
Mojo::Parameters(3pm) User Contributed Perl Documentation Mojo::Parameters(3pm)NAME
Mojo::Parameters - Parameter container
SYNOPSIS
use Mojo::Parameters;
my $p = Mojo::Parameters->new(foo => 'bar', baz => 23);
DESCRIPTION
Mojo::Parameters is a container for form parameters.
ATTRIBUTES
Mojo::Parameters implements the following attributes.
"charset"
my $charset = $p->charset;
$p = $p->charset('UTF-8');
Charset used for decoding parameters, defaults to "UTF-8".
"pair_separator"
my $separator = $p->pair_separator;
$p = $p->pair_separator(';');
Separator for parameter pairs, defaults to "&".
METHODS
Mojo::Parameters inherits all methods from Mojo::Base and implements the following new ones.
"new"
my $p = Mojo::Parameters->new;
my $p = Mojo::Parameters->new('foo=b%3Bar&baz=23');
my $p = Mojo::Parameters->new(foo => 'b;ar');
my $p = Mojo::Parameters->new(foo => ['ba;r', 'b;az']);
my $p = Mojo::Parameters->new(foo => ['ba;r', 'b;az'], bar => 23);
Construct a new Mojo::Parameters object.
"append"
$p = $p->append(foo => 'ba;r');
$p = $p->append(foo => ['ba;r', 'b;az']);
$p = $p->append(foo => ['ba;r', 'b;az'], bar => 23);
Append parameters.
# "foo=bar&foo=baz"
Mojo::Parameters->new('foo=bar')->append(foo => 'baz');
# "foo=bar&foo=baz&foo=yada"
Mojo::Parameters->new('foo=bar')->append(foo => ['baz', 'yada']);
# "foo=bar&foo=baz&foo=yada&bar=23"
Mojo::Parameters->new('foo=bar')->append(foo => ['baz', 'yada'], bar => 23);
"clone"
my $p2 = $p->clone;
Clone parameters.
"merge"
$p = $p->merge(Mojo::Parameters->new(foo => 'b;ar', baz => 23));
Merge parameters.
"param"
my @names = $p->param;
my $foo = $p->param('foo');
my @foo = $p->param('foo');
my $foo = $p->param(foo => 'ba;r');
my @foo = $p->param(foo => qw(ba;r ba;z));
Check and replace parameter values.
"params"
my $params = $p->params;
$p = $p->params([foo => 'b;ar', baz => 23]);
Parsed parameters.
"parse"
$p = $p->parse('foo=b%3Bar&baz=23');
Parse parameters.
"remove"
$p = $p->remove('foo');
Remove parameters.
# "bar=yada"
Mojo::Parameters->new('foo=bar&foo=baz&bar=yada')->remove('foo');
"to_hash"
my $hash = $p->to_hash;
Turn parameters into a hash reference.
# "baz"
Mojo::Parameters->new('foo=bar&foo=baz')->to_hash->{foo}[1];
"to_string"
my $string = $p->to_string;
Turn parameters into a string.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Parameters(3pm)