Hello,
I kinda newbie in unix so I would like so help.I know that there is a command that compares two integer numbers test (eg. #$1=0 ).I would like to know if it is possible to compare any number with another (eg. 2.3=0 or 3.7!=0 4.5>2.2).
Thank you in advance. (1 Reply)
Hello, I'm searching for a quick method to read numeric values from a file or a defined variable and identifying the largest number. For instance if the following numbers are in a file or defined to a variable:
09192007 09202007 09182007 09172007 09162007
What "short" method could be used to... (7 Replies)
Hi There!
Apologies if this has been asked previously but I couldn't find the answer I was hoping for.
Basically, all I want to do is compare the OS X version against the version that I require in my script. So I'm retrieving the OS version using defaults read, but how can I compare this... (10 Replies)
Hi!
I've come up with a ksh-script that produces one or more lists of hosts.
At the and of the script, I would like to print only those hosts that exists in all the lists.
Ex.
HOSTS="host1 host2 host3 host11"
HOSTS="host1 host2 host4"
HOSTS="host2 host11"
HOSTS="host2 host5 host6 host7... (1 Reply)
Hi,
I am a noob at shell scripting.
basically I am trying to compare row counts from 8 tables in different databases. I have managed to get the row counts using awk from the spool files for both databases.
now I have 16 variables with me
for database 1 :
$A
$B
$C
$D
$E
$F
$G... (3 Replies)
Im trying to compare two numbers with decimals but its not working as expected.
a=1
b=1.1
if
then echo "equal"
fi
When I do this it says that the numbers are equal. Ultimately Im using -le and -ge in the if statements but I tested with -eq for simplicity.
Any way to make this... (3 Replies)
Hi. I do not know how to compare numbers and need help. In my script I have to figure the MAX, MIN, & Avg. Sales amounts.
Please help me.
In the code, "transaction" is a counter.
#!/bin/bash
clear
transaction=0
sales=0
total=0
while test $sales
... (9 Replies)
ValA=-29344
if ; then
echo "NEGATIVE"
else
echo "POSITIVE"
fi
Can someone please tell me how else they would go about doing the above?
When i do it, i get errors such as: (10 Replies)
For numbers between 0 and 1 the below logic is not working.
Output of above shall be "correct" but its echoing "incorrect".Kindly suggest
a=.1
if
then
echo correct
else echo incorrect
fi
Video tutorial on how to use code tags in The UNIX and Linux Forums. (3 Replies)
Discussion started by: itsvikas
3 Replies
LEARN ABOUT PHP
msgfmt_set_pattern
MSGFMT_SET_PATTERN(3) 1 MSGFMT_SET_PATTERN(3)MessageFormatter::setPattern - Set the pattern used by the formatter
Object oriented style
SYNOPSIS
public bool MessageFormatter::setPattern (string $pattern)
DESCRIPTION
Procedural style
bool msgfmt_set_pattern (MessageFormatter $fmt, string $pattern)
Set the pattern used by the formatter
PARAMETERS
o $fmt
- The message formatter
o $pattern
- The pattern string to use in this message formatter. The pattern uses an 'apostrophe-friendly' syntax; it is run through
umsg_autoQuoteApostrophe before being interpreted.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
msgfmt_set_pattern(3) example
<?php
$fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" );
echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'
";
echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "
";
msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" );
echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'
";
echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "
";
?>
Example #2
OO example
<?php
$fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" );
echo "Default pattern: '" . $fmt->getPattern() . "'
";
echo "Formatting result: " . $fmt->format(array(123, 456)) . "
";
$fmt->setPattern("{0, number} trees hosting {1, number} monkeys" );
echo "New pattern: '" . $fmt->getPattern() . "'
";
echo "Formatted number: " . $fmt->format(array(123, 456)) . "
";
?>
The above example will output:
Default pattern: '{0,number} monkeys on {1,number} trees'
Formatting result: 123 monkeys on 456 trees
New pattern: '{0,number} trees hosting {1,number} monkeys'
Formatted number: 123 trees hosting 456 monkeys
SEE ALSO msgfmt_create(3), msgfmt_get_pattern(3).
PHP Documentation Group MSGFMT_SET_PATTERN(3)