Hi,
I am trying to use && set up to match two conditions within ksh:
if &&
then
'''Do something
if
somehow, I keep getting error message telling me that ] is missing.
What's wrong with my code?
Thanks a lot for your help! (1 Reply)
I'm totally new with bash programming and I don't get it how to put two conditions in one if statement. My code looks like this:
h=`date +%k`
if && ]; then$h is 10 but I don't get into my if statement. What's wrong here? (5 Replies)
I have a text file that contains lines similar to the following:
-----------------------------------------------------------
fall for setup
CSHRC0 'gnd';
CSHR0 'gnd';
rise for setup
rise for hold
CSHRC0 'gnd';
CSHR0 'gnd';
fall for hold ... (4 Replies)
I have a script that runs on multiple servers. What I want to do is have the script do the following:
if $(hostname) is equal to server or server2
then
TO_DIR=go
else
TO_DIR=stop
fi
I have tried:
if
if ]
Server is hpux.
any ideas? (1 Reply)
is it possible to use multiple conditions in a CASE statement? And if so, what is the syntax? I'm trying to use one but can't seem to get it right. I want the statement to be
CASE $vendor OR $alias
condition 1) statements;
condition 2) statements;
etc.
esac
but I keep... (25 Replies)
When I try the below if Condition with single condition its working fine.
But when I try to Club both its working . But giving wrong results.
In my case
cond1 = -f ${filename1} = true
cond2 = -f ${filename2} = true
But Cond1 & Cond2 is resulting in False ??? Please advise
... (5 Replies)
Hello,
I am using shell scripting and I am recieving odd results from my if statement
if
I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
I was trying to write multiple conditions inside the if statement but its not working.
export VAR_NM=abc.txt
export CURR_DT=20131011
export PREV_DT=20131012
if &&
then
echo "Yes"
else
echo "NO"
fi
It should return Yes but returning NO always.Appreciate any help. (3 Replies)
#!/bin/bash
if &&
then
echo "True"
else
echo "False"
fi
Hi everyone, I am new to UNIX, here I have a if statement elevating two boolean conditions. I thought the output should be True because there are + in the statement. But it turns out to be False.
Can anyone... (3 Replies)
I wish to check two conditions inside the if statement
Condition 1: The two file contents should be identical // using cmp command for this.
Condition 2: The two filenames should NOT be the same.
This is what i did in vain.
if ]; then
where entry1 and entry2 are
ls *.txt | while... (7 Replies)
Discussion started by: mohtashims
7 Replies
LEARN ABOUT DEBIAN
dancer::config::object
Dancer::Config::Object(3pm) User Contributed Perl Documentation Dancer::Config::Object(3pm)NAME
Dancer::Config::Object - Access the config via methods instead of hashrefs
DESCRIPTION
If "strict_config" is set to a true value in the configuration, the "config()" subroutine will return an object instead of a hashref.
Instead of this:
my $serializer = config->{serializer};
my $username = config->{auth}{username};
You get this:
my $serializer = config->serializer;
my $username = config->auth->username;
This helps to prevent typos. If you mistype a configuration name:
my $pass = config->auth->pass;
An exception will be thrown, tell you it can't find the method name, but listing available methods:
Can't locate config attribute "pass".
Available attributes: password, username
If the hash key cannot be converted into a proper method name, you can still access it via a hash reference:
my $some_value = config->{'99_bottles'};
And call methods on it, if possible:
my $sadness = config->{'99_more_bottles'}->last_bottle;
Hash keys pointing to hash references will in turn have those "objectified". Arrays will still be returned as array references. However,
hashrefs inside of the array refs may still have their keys allowed as methods:
my $some_value = config->some_list->[1]->host;
METHOD NAME DEFINITION
We use the following regular expression to determine if a hash key qualifies as a method:
/^[[:alpha:]_][[:word:]]*$/;
Note that this means "naA~Xve" (note the dots over the i) can be a method name, but unless you "use utf8;" to declare that your source code
is UTF-8, you may have disappointing results calling "config->naA~Xve". Further, depending on your version of Perl and the software to read
your config file ... well, you get the idea. We recommend sticking with ASCII identifiers if you wish your code to be portable.
Patches/suggestions welcome.
AUTHOR
This module has been written by Alexis Sukrieh <sukria@cpan.org> and others, see the AUTHORS file that comes with this distribution for
details.
LICENSE
This module is free software and is released under the same terms as Perl itself.
SEE ALSO
Dancer and Dancer::Config.
perl v5.14.2 2012-03-31 Dancer::Config::Object(3pm)