Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-28-2013, 04:41 AM   #1
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
How to set condition for found result?


I am going to write a script. It will check if any file size greater than 10k, assumed. If yes, it will print out the result. If no, it will print out NOK.

The command is as follow:

find /var/log/jboss-apps/test -type f -size +10k
My script look as follow:

result=$(find /var/log/jboss-apps/test -type f -size +10k)

echo RESULT=$result

if [[ $result -z ]]; then
  echo OK
  echo NOK
But I got error:

./ line 10: conditional binary operator expected
./ line 10: syntax error near `-z'
./ line 10: `if [[ $result -z ]]; then'

Last edited by thomas2004ch; 10-28-2013 at 04:44 AM.
Old 10-28-2013, 04:48 AM   #2
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
I've solved the problem. Therer is error in the script.

Please don't reply my post anymore.

Last edited by thomas2004ch; 10-28-2013 at 05:07 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
check Negative egrep condition in an if condition novicunix Programming 5 02-02-2013 01:52 AM
kdevelop, debugging - how to set a valid condition for a watchpoint? onufry Programming 4 07-17-2009 02:32 PM
LQ Search result links cannot be found rnturn LQ Suggestions & Feedback 12 01-11-2008 06:11 PM
I can't believe it -- I just found a complete Win 3.11 install set! BinJajer General 9 02-06-2006 12:33 AM
result set Database problem dai Programming 8 04-11-2003 06:11 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration