Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unary Operator Message - Linux/Unix Post 302572893 by jim mcnamara on Friday 11th of November 2011 03:11:12 PM
Old 11-11-2011
This script has serious issues. If you are looking for files > 20000 bytes (an example)
do this:

Code:
lim=20000
ls -ls | sort -rn | 
  awk -v lim=$lim ' $6>= lim { print $ 0; next}  {exit} '  > /path/to/outputfile

This puts the files in order from big -> small, and reads until the filesize $6 is less than the variable lim.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unary operator expected

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)
Discussion started by: Satyak
2 Replies

2. UNIX for Dummies Questions & Answers

[: =: unary operator expected

HI, while running a script, I got the below mentioned error. /bin/sh: line10 : supportedMozillaVersion() { case "$*" in *rv:1.*) return 0;; *rv:.*) return 0;; *rv:*) return 1;; Mozilla\ 1.*) return 0;; Mozilla\ .*) return 0;; *) return 1;; esac } supportedFirefoxVersion() { case... (7 Replies)
Discussion started by: bhag281
7 Replies

3. Shell Programming and Scripting

unary operator expected

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)
Discussion started by: timgolding
3 Replies

4. Shell Programming and Scripting

line 5: [: -gt: unary operator expected

Hello all, :confused: I am not getting this error. Pls help me. ./construct_operon.sh: line 5: #!/bin/bash # Construct Operons using gene pairs. rm -rf operons_result lines=`awk 'END {print NR}' ecoli_operons` while ; do head -1 ecoli_operons | awk '{print $1"\n"$2}' > pattern ... (5 Replies)
Discussion started by: admax
5 Replies

5. Shell Programming and Scripting

unary operator is missing

hi , i m getting an error unary operator is missing. pls check why is this so? i=5 while test $i !=0 do echo $i i=`expr $i - 1` done (3 Replies)
Discussion started by: angel12345
3 Replies

6. UNIX for Dummies Questions & Answers

[: =: unary operator expected error

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)
Discussion started by: mbf123
24 Replies

7. Shell Programming and Scripting

unary operator expected

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)
Discussion started by: sunrexstar
1 Replies

8. UNIX for Dummies Questions & Answers

: unary operator expected

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)
Discussion started by: cyberfrog
4 Replies

9. UNIX for Dummies Questions & Answers

[: -gt: unary operator expected

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)
Discussion started by: fotex
1 Replies

10. Shell Programming and Scripting

Unary operator expected

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
CREATEABLBINEXPR(3)						   ABL FUNCTIONS					       CREATEABLBINEXPR(3)

NAME
createablbinexpr - creates a binary operator expression. ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "abl101.h" chain_list *createablbinexpr( Oper, Expr1, Expr2 ) long Oper; chain_list *Expr1; chain_list *Expr2; PARAMETERS
Oper The operator number. Expr1 The first expression. Expr2 The second expression. DESCRIPTION
createablbinexpr creates the binary operator expression Expr1 Operator Expr2. If the operator of Expr1 and/or Expr2, and Operator are identicals createablbinexpr merges eventually the sub-expressions. The expression pointers Expr1 and Expr2 MUSTN'T be used after the call to this function. RETURN VALUE
createablbinexpr returns a pointer to the new operator expression. ERRORS
"ablcreate: bad operator xx !", Operator must be defined and must be a binary operator. EXAMPLE
#include "abl101.h" chain_list *ExprA; chain_list *ExprB; chain_list *ExprAorB; ExprA = createablatom( "a" ); ExprB = createablatom( "b" ); ExprAorB = createablbinexpr( ABL_OR, ExprA, ExprB ); SEE ALSO
abl(1) createablatom(3), createabloper(3), createablxorbinexpr(3), createablunaryexpr(3), createablnotexpr(3), addablhexpr(3), addablq- expr(3). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 CREATEABLBINEXPR(3)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy