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 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)
echo "please enter ur choice..
1. Make a file.
2. Display contents
3. Copy the file
4. Rename the file
5. Delete the file
6. Exit"
read choice
case $choice in
1 ) echo enter the file name
read fname
if
then
echo... (2 Replies)
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)
Hello,
I'm trying to put together a script that involves pulling data from a config file. I'm attempting to write an if statement to validate one of the pieces of data from the config file, but I think I'm fat fingering it somehow.
$config{VALUE} is being pulled from a config file but can only... (4 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)
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)
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 CENTOS
ppix::utilities::node
PPIx::Utilities::Node(3) User Contributed Perl Documentation PPIx::Utilities::Node(3)NAME
PPIx::Utilities::Node - Extensions to PPI::Node.
VERSION
This document describes PPIx::Utilities::Node version 1.1.0.
SYNOPSIS
use PPIx::Utilities::Node qw< split_ppi_node_by_namespace >;
my $dom = PPI::Document->new("...");
while (
my ($namespace, $sub_doms) = each split_ppi_node_by_namespace($dom)
) {
foreach my $sub_dom ( @{$sub_doms} ) {
...
}
}
DESCRIPTION
This is a collection of functions for dealing with PPI::Nodes.
INTERFACE
Nothing is exported by default.
split_ppi_node_by_namespace($node)
Returns the sub-trees for each namespace in the node as a reference to a hash of references to arrays of PPI::Nodes. Say we've got the
following code:
#!perl
my $x = blah();
package Foo;
my $y = blah_blah();
{
say 'Whee!';
package Bar;
something();
}
thingy();
package Baz;
da_da_da();
package Foo;
foreach ( blrfl() ) {
...
}
Calling this function on a PPI::Document for the above returns a value that looks like this, using multi-line string literals for the
actual code parts instead of PPI trees to make this easier to read:
{
main => [
q<
#!perl
my $x = blah();
>,
],
Foo => [
q<
package Foo;
my $y = blah_blah();
{
say 'Whee!';
}
thingy();
>,
q<
package Foo;
foreach ( blrfl() ) {
...
}
>,
],
Bar => [
q<
package Bar;
something();
>,
],
Baz => [
q<
package Baz;
da_da_da();
>,
],
}
Note that the return value contains copies of the original nodes, and not the original nodes themselves due to the need to handle
namespaces that are not file-scoped. (Notice how the first element for "Foo" above differs from the original code.)
BUGS AND LIMITATIONS
Please report any bugs or feature requests to "bug-ppix-utilities@rt.cpan.org", or through the web interface at <http://rt.cpan.org>.
AUTHOR
Elliot Shank "<perl@galumph.com>"
COPYRIGHT
Copyright (c)2009-2010, Elliot Shank "<perl@galumph.com>".
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 2010-12-02 PPIx::Utilities::Node(3)