Sponsored Content
Full Discussion: Getting error in if loop
Top Forums Shell Programming and Scripting Getting error in if loop Post 302878201 by netdbaind on Thursday 5th of December 2013 03:51:20 AM
Old 12-05-2013
Thanks for quick reply..!!

I changed the code and now I'm getting this Error.

Code:
 
if_test: line 1: [: -gt: unary operator expected
if_test: line 4: [: -gt: unary operator expected

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Error in for loop?

Hi, Working on AIX using the following for loop. for a in `find /edi/iTracTEST/sessions -name nohup.out -print` do echo $a done On the command line it works fine, but insert the code in a file and then running it, it does not want to work. I get the following back. ' is not... (3 Replies)
Discussion started by: hugow
3 Replies

2. Shell Programming and Scripting

Error in Loop?

hi friends, i wrote one simple shell script.. in that am using for loop... when i am trying to execute the script.it shows syntax error at for loop line '((' unexpected. #!/bin/ksh ## ##### To find no of files in the directory NOF=`ls -l /root/COMM/LOGS/eds/20081025| wc -l`... (5 Replies)
Discussion started by: rdhaprakasam
5 Replies

3. Solaris

Error in while loop

Hi, Iam trying to add a while loop in my script in the below way which gets value from count file and checks if its not equal to 0.If yes then it shld echo me a message. while //count file has some number other than 0 do echo "count is not zero" done But iam getting this error:... (5 Replies)
Discussion started by: jyothi_wipro
5 Replies

4. UNIX for Dummies Questions & Answers

error in for loop???

Hi, I get the following output 98 -1 98 0 ./get_AB04-time: line 79: ((: i< && 0 !=7 : syntax error: operand expected (error token is "&& 0 !=7 ") I have this part of code. Line 79 is the line of the for loop. echo ${OCCURRENCE} $i_START CASE=0; i_END=${i_START}... (4 Replies)
Discussion started by: f_o_555
4 Replies

5. Shell Programming and Scripting

Error Using an if Loop Within a While Loop

Hello All, I am having a problem with an “if loop” within a “while loop” in my Korn Shell program. The basic concept of the program is that it searches for the existence of a series of load files in a load directory, and once it finds one of these files, it begins the following process: · Creates... (4 Replies)
Discussion started by: jonesdk5
4 Replies

6. Shell Programming and Scripting

Error with while loop

the program just prints all the command line arguments Getting error in the program error ./hellow: line 13: 0: command not found ./hellow: line 13: 0: command not found below is the program #!/bin/bash num=$# echo $num if then echo "No arguments are passed ." else ... (7 Replies)
Discussion started by: BHASKARREDDY006
7 Replies

7. Shell Programming and Scripting

Error in while loop

I have a file Table.out having table name like this Table_Emp Table_Exp Table_Fcr To show first 10 rows .. I' wrtng a script like this .. #!/bin/ksh cat /tmp/table.out|while read -r table vbar1 do <connect to db> then select * from $table limit 10; > /tmp/1.out done ... (3 Replies)
Discussion started by: netdbaind
3 Replies

8. Shell Programming and Scripting

Error in loop

This is my first ever bash script. What i wish to achieve is to find all files in current directory except the script file and count lines in each found file. Some thing seems to be wrong with the if statement :confused: Please help why it does not work? and maybe you have some ideas how to improve... (3 Replies)
Discussion started by: chinababy
3 Replies

9. Shell Programming and Scripting

Error in for loop

I was trying to implement a nested for do loop to run a perl script. for i in 1 10 50 do for j in 2 12 55 do perl script.pl "$i" "$i" "$j" done done when I implemented it within a shell script, i got the output, but every time j value will 55, or basically the last value of j in... (10 Replies)
Discussion started by: Kanja
10 Replies

10. UNIX for Beginners Questions & Answers

Error with for loop

There are two files abc_123.dat and abc_345.dat if at least one file exists then enter into the loop and remove file and exit. In first iteration, deleting files successfully but "else" statement executing after deleting files."else" should execute only if there is no file in the directory.... (1 Reply)
Discussion started by: Rajesh123
1 Replies
CREATE 
OPERATOR(7) PostgreSQL 9.2.7 Documentation CREATE OPERATOR(7) NAME
CREATE_OPERATOR - define a new operator SYNOPSIS
CREATE OPERATOR name ( PROCEDURE = function_name [, LEFTARG = left_type ] [, RIGHTARG = right_type ] [, COMMUTATOR = com_op ] [, NEGATOR = neg_op ] [, RESTRICT = res_proc ] [, JOIN = join_proc ] [, HASHES ] [, MERGES ] ) DESCRIPTION
CREATE OPERATOR defines a new operator, name. The user who defines an operator becomes its owner. If a schema name is given then the operator is created in the specified schema. Otherwise it is created in the current schema. The operator name is a sequence of up to NAMEDATALEN-1 (63 by default) characters from the following list: + - * / < > = ~ ! @ # % ^ & | ` ? There are a few restrictions on your choice of name: o -- and /* cannot appear anywhere in an operator name, since they will be taken as the start of a comment. o A multicharacter operator name cannot end in + or -, unless the name also contains at least one of these characters: ~ ! @ # % ^ & | ` ? For example, @- is an allowed operator name, but *- is not. This restriction allows PostgreSQL to parse SQL-compliant commands without requiring spaces between tokens. o The use of => as an operator name is deprecated. It may be disallowed altogether in a future release. The operator != is mapped to <> on input, so these two names are always equivalent. At least one of LEFTARG and RIGHTARG must be defined. For binary operators, both must be defined. For right unary operators, only LEFTARG should be defined, while for left unary operators only RIGHTARG should be defined. The function_name procedure must have been previously defined using CREATE FUNCTION and must be defined to accept the correct number of arguments (either one or two) of the indicated types. The other clauses specify optional operator optimization clauses. Their meaning is detailed in Section 35.13, "Operator Optimization Information", in the documentation. To be able to create an operator, you must have USAGE privilege on the argument types and the return type, as well as EXECUTE privilege on the underlying function. If a commutator or negator operator is specified, you must own these operators. PARAMETERS
name The name of the operator to be defined. See above for allowable characters. The name can be schema-qualified, for example CREATE OPERATOR myschema.+ (...). If not, then the operator is created in the current schema. Two operators in the same schema can have the same name if they operate on different data types. This is called overloading. function_name The function used to implement this operator. left_type The data type of the operator's left operand, if any. This option would be omitted for a left-unary operator. right_type The data type of the operator's right operand, if any. This option would be omitted for a right-unary operator. com_op The commutator of this operator. neg_op The negator of this operator. res_proc The restriction selectivity estimator function for this operator. join_proc The join selectivity estimator function for this operator. HASHES Indicates this operator can support a hash join. MERGES Indicates this operator can support a merge join. To give a schema-qualified operator name in com_op or the other optional arguments, use the OPERATOR() syntax, for example: COMMUTATOR = OPERATOR(myschema.===) , NOTES
Refer to Section 35.12, "User-defined Operators", in the documentation for further information. It is not possible to specify an operator's lexical precedence in CREATE OPERATOR, because the parser's precedence behavior is hard-wired. See Section 4.1.6, "Operator Precedence", in the documentation for precedence details. The obsolete options SORT1, SORT2, LTCMP, and GTCMP were formerly used to specify the names of sort operators associated with a merge-joinable operator. This is no longer necessary, since information about associated operators is found by looking at B-tree operator families instead. If one of these options is given, it is ignored except for implicitly setting MERGES true. Use DROP OPERATOR (DROP_OPERATOR(7)) to delete user-defined operators from a database. Use ALTER OPERATOR (ALTER_OPERATOR(7)) to modify operators in a database. EXAMPLES
The following command defines a new operator, area-equality, for the data type box: CREATE OPERATOR === ( LEFTARG = box, RIGHTARG = box, PROCEDURE = area_equal_procedure, COMMUTATOR = ===, NEGATOR = !==, RESTRICT = area_restriction_procedure, JOIN = area_join_procedure, HASHES, MERGES ); COMPATIBILITY
CREATE OPERATOR is a PostgreSQL extension. There are no provisions for user-defined operators in the SQL standard. SEE ALSO
ALTER OPERATOR (ALTER_OPERATOR(7)), CREATE OPERATOR CLASS (CREATE_OPERATOR_CLASS(7)), DROP OPERATOR (DROP_OPERATOR(7)) PostgreSQL 9.2.7 2014-02-17 CREATE OPERATOR(7)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy