hi
i am trying to compare a value with value 50. but i am getting
"
I am using
if
then
echo "------------"
fi
please help
thanks in advance
Satya (2 Replies)
Im trying to fix my /etc/weekly that rotates various logs however it does them no matter what filesize they are and i want them to only do it if there file size exceeds 2M or something. So I'm playing with a script to get the filesize using a ls -l command which works and puts the value into a... (3 Replies)
find . -name "*.*"|xargs grep WT:DBF_WL>> $F
Wfexist=`cat $F|grep $i`
echo $Wfexist
if ;
then
echo $Wfexist
echo "Workflow Exist"
else
touch $O
chmod 777 $O
echo $Wfexist
echo $WfExist >> $O
fi
I am getting the error that -ne: unary operator expected in the line with red... (2 Replies)
Why am I getting this error.... #!/bin/sh
# iOS-Ad-Remover
# Marshall Ford @ marshallbford@gmail.com
# This project is hosted @ http://ios-ad-
# remover.sourceforge.net
# Under the GNU GPL open source license
clear
echo
if ; then echo "You need to be root to run this script."; exit 0; #... (24 Replies)
i=0
while
Shell script reports an error "unary operator expected" pointing the above line.
$i by default is 0 and holds integer value and $buf is also holding integer value.
Please can some one let me know what is missing.
Thanks. (1 Reply)
Hiya all,
Why do I get a :unary operator expected when I try to put a condition statement in my shell script (sh) like so and how to fix?
if ; then
echo "say hello"
else
echo "don't say hello"
fi
? It seems if the script receives an argument it works but if I don't put an... (4 Replies)
Hi
I have problem with my script.
I dont now why but i don't change anything and script stop working.
this is my code:
#!/bin/sh
for i in `ps -A | grep pocron.sh | grep -v grep | awk '{print $2}'`
do
COUNT=$((COUNT+1))
done
ostatnie_wykonanie=`cat porader.log`... (1 Reply)
Hi All,
I'm assigning a numeric value to variable count=2, well its being assigned by code above the if condition.
I want to test for 2 conditions , when $count = 0 or $count <=2 and do something when the condition matches. here is my code, but i run into the infamous :
if ]
then
... (2 Replies)
In all my Googling, this usually happens when someone is comparing a variable, and that variable is unset. That doesn't appear to be the case for me...
#!/bin/bash -x
while read line
do
f=$(echo $line | tr -s ' ' | cut -d' ' -f 3)
echo $f
if
then
echo "This... (2 Replies)
Discussion started by: jnojr
2 Replies
LEARN ABOUT PHP
pg_meta_data
PG_META_DATA(3)PG_META_DATA(3)pg_meta_data - Get meta data for tableSYNOPSIS
array pg_meta_data (resource $connection, string $table_name, [bool $extended])
DESCRIPTION pg_meta_data(3) returns table definition for table_name as an array.
PARAMETERS
o $connection
- PostgreSQL database connection resource.
o $table_name
- The name of the table.
o $extended
- Flag for returning extended meta data. Default to FALSE.
RETURN VALUES
An array of the table definition, or FALSE on error.
EXAMPLES
Example #1
Getting table metadata
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$meta = pg_meta_data($dbconn, 'authors');
if (is_array($meta)) {
echo '<pre>';
var_dump($meta);
echo '</pre>';
}
?>
The above example will output:
array(3) {
["author"]=>
array(5) {
["num"]=>
int(1)
["type"]=>
string(7) "varchar"
["len"]=>
int(-1)
["not null"]=>
bool(false)
["has default"]=>
bool(false)
}
["year"]=>
array(5) {
["num"]=>
int(2)
["type"]=>
string(4) "int2"
["len"]=>
int(2)
["not null"]=>
bool(false)
["has default"]=>
bool(false)
}
["title"]=>
array(5) {
["num"]=>
int(3)
["type"]=>
string(7) "varchar"
["len"]=>
int(-1)
["not null"]=>
bool(false)
["has default"]=>
bool(false)
}
}
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.6.0 | |
| | |
| | No longer experimental. Added "is enum" as |
| | default attribute. $extended flag is added. |
| | |
+--------+---------------------------------------------------+
SEE ALSO pg_convert(3).
PHP Documentation Group PG_META_DATA(3)