I have gotten the script up to this point and it works fine a system but when i copy it to another unix server running solaris 9 as the original one , its gives an error './mon_fs.sh: 0: unknown test operator' .
(see script bellow)
can the Gurus see to this as i am just a beginner with... (2 Replies)
Hi,
I have the following shell script :
Nbr_BD_Link=0
Nbr_BD_Link=`
sqlplus sysadm/${PSWD}@${DB_Name} << EOF | tail -4 | head -1 2>/dev/null
set head off feedback off ;
select count(*) from dba_db_links ;
exit ;
EOF `
echo ${Nbr_BD_Link}
if ; then
... (4 Replies)
hi
I get test: unknown operator status
if
then
echo "OK."
return 0
else
echo "not ok" 2>&1
exit -1
fi
I tried to change "A" with 'A' --> same error
I tried to change
if , I am getting: (3 Replies)
Hi All,
can some one figure out the syntax issue here. How to overcome this?
#!/bin/sh
$ HFR_MAIL=NO
$ PRP_MAIL=NO
$ MC_MAIL=NO
$ if && && ]; then
> echo "NO "
> else
> echo "YES"
> fi
test: unknown operator NO
$ if && && ]; then
> echo "NO"
> else
> echo "YES"
>... (4 Replies)
hi all, i am using the below command in my script
if ; then
This statement is causing the problme "ScriptName.ksh: XXX-XXX: unknown test operator"
could you please suggest me , how can i avoid these messages.
Singhal (7 Replies)
Im trying to check if a series of directory exists and if not create them, and am having issues. All the instances of test return with the error "test:
#!/bin/bash
location_Parent=~/Documents/sight_of_sound
location_IMG=~/Documents/Sight_of_sound/IMG
location_AUD=~/Documents/Sight_of_sound/AUD... (4 Replies)
Hi
I am trying to figure out what the following line does, I work in ksh88:
] && LIST="$big $LIST"
Not sure what "-a" means in that case.
Thanks a lot for any advice -A (1 Reply)
Hi ,
Os - Solaris
Shell - Ksh
I am getting below error in if condition
+ id
+
./om_wf_complete.sh: gid=4081(Infadmn): unknown test operator
+ exit 1
if ; then
touch /home/odwt/1.0.0/out/oworkflow.dat
chmod 777 /home/odwt/1.0.0/out/oworkflow.dat
elif ; then
touch... (8 Replies)
O/S solaris 9
shell ksh
if
then
chk_op="WARNING...reboot within the last 24hrs, restarted at `who -r | awk '{print $4$5"@"$6}'`" ;
else
if ;
then
last_reboot1=`who -b | awk '{print $4" "$5" "$6}'`
last_reboot2='..OK..'`uptime | awk '{print$3" "$4}'`
... (4 Replies)
Please can you help me understand the significance of providing arguments under sh -s in
> ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies
LEARN ABOUT PHP
version_compare
VERSION_COMPARE(3) 1 VERSION_COMPARE(3)version_compare - Compares two "PHP-standardized" version number strings
SYNOPSIS
mixed version_compare (string $version1, string $version2, [string $operator])
DESCRIPTION version_compare(3) compares two "PHP-standardized" version number strings.
The function first replaces _, - and + with a dot . in the version strings and also inserts dots . before and after any non number so that
for example '4.3.2RC1' becomes '4.3.2.RC.1'. Then it compares the parts starting from left to right. If a part contains special version
strings these are handled in the following order: any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p.
This way not only versions with different levels like '4.1' and '4.1.2' can be compared but also any PHP specific version containing devel-
opment state.
PARAMETERS
o $version1
- First version number.
o $version2
- Second version number.
o $operator
- If the third optional $operator argument is specified, test for a particular relationship. The possible operators are: <, lt,
<=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. This parameter is case-sensitive, values should be lowercase.
RETURN VALUES
By default, version_compare(3) returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is
lower.
When using the optional $operator argument, the function will return TRUE if the relationship is the one specified by the operator, FALSE
otherwise.
EXAMPLES
The examples below use the PHP_VERSION constant, because it contains the value of the PHP version that is executing the code.
Example #1
version_compare(3) examples
<?php
if (version_compare(PHP_VERSION, '6.0.0') >= 0) {
echo 'I am at least PHP version 6.0.0, my version: ' . PHP_VERSION . "
";
}
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
echo 'I am at least PHP version 5.3.0, my version: ' . PHP_VERSION . "
";
}
if (version_compare(PHP_VERSION, '5.0.0', '>=')) {
echo 'I am using PHP 5, my version: ' . PHP_VERSION . "
";
}
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
echo 'I am using PHP 4, my version: ' . PHP_VERSION . "
";
}
?>
NOTES
Note
The PHP_VERSION constant holds current PHP version.
Note
Note that pre-release versions, such as 5.3.0-dev, are considered lower than their final release counterparts (like 5.3.0).
Note
Special version strings such as alpha and beta are case sensitive. Version strings from arbitrary sources that do not adhere to the
PHP standard may need to be lowercased via strtolower(3) before calling version_compare(3).
SEE ALSO phpversion(3), php_uname(3), function_exists(3).
PHP Documentation Group VERSION_COMPARE(3)