The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error "test: [-d: unary operator expected" very confused. orionrush Shell Programming and Scripting 4 06-14-2009 11:27 AM
unary operator expected timgolding Shell Programming and Scripting 3 04-03-2009 11:13 AM
[: =: unary operator expected bhag281 UNIX for Dummies Questions & Answers 7 03-10-2009 09:47 AM
unary operator expected Satyak Shell Programming and Scripting 2 03-06-2009 02:56 PM
unary operator expected error ssuresh1999 UNIX for Dummies Questions & Answers 2 10-28-2008 09:33 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-02-2009
admax's Avatar
admax admax is offline
Registered User
  
 

Join Date: Oct 2009
Location: Bangalore / India
Posts: 14
line 5: [: -gt: unary operator expected

Hello all,
I am not getting this error.
Pls help me.


Code:
./construct_operon.sh: line 5: [: -gt: unary operator expected


Code:
#!/bin/bash
# Construct Operons using gene pairs.
rm -rf operons_result
lines=`awk 'END {print NR}' ecoli_operons`
while [ $lines -gt 0 ];
do
    head -1 ecoli_operons | awk '{print $1"\n"$2}' > pattern
    grep -f pattern ecoli_operons | awk '{print $1"\n"$2}' > temp
    pat_count=`grep -f pattern -v temp | awk 'END {print NR}'`
    while [ $pat_count -gt 0 ];
    do
        cat temp >> pattern
        grep -f pattern ecoli_operons | awk '{print $1"\n"$2}' > temp
        pat_count=`grep -f pattern -v temp | awk 'END {print NR}'`
    done
    grep -f pattern ecoli_operons | awk '{print $1"\n"$2}' | sort -u | awk '{printf $0"\t"} END {printf"\n"}' >> operons_result
    grep -f pattern -v ecoli_operons > temp1
    mv temp1 ecoli_operons
    echo $lines
    lines=`awk 'END {print NR}' ecoli_operons`
done
rm -rf temp
rm -rf pattern

Thanks in advance.

Last edited by radoulov; 11-02-2009 at 10:28 AM.. Reason: Please use code tags!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0