473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"binary operator expected" message

Hi!
My second post, very similar to the first one.
I just mounted a debian server and start to run some few scripts. They "seem" to run, but sometimes (5% of times) I am getting this error message:

Expand|Select|Wrap|Line Numbers
  1. /home/jmd/sh/muestras.sh: line 2: [: R0220444: binary operator expected
Note that R0220444 is one of the files in /home/as400/muestras folder.

This is /home/jmd/sh/muestras.sh:
Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. if [ -z $(ls /home/as400/muestras) ]
  3. then
  4.         echo "" > /dev/null
  5. else
  6.         /home/jmd/sh/muestrasR.sh
  7. fi

And this is /home/jmd/sh/muestrasR.sh
Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. cd /home/as400/muestras
  3. touch prueba
  4.  
  5. for i in `ls *`; do
  6. fichero=`echo $i | cut -d. -f1`
  7. txt2html -pb 0 --infile $fichero --outfile $fichero.html
  8. done
  9.  
  10. for i in `ls *.html`; do
  11. fichero=`echo $i | cut -d. -f1`
  12. htmldoc --quiet --left 4mm --fontsize 12 --textfont helvetica --webpage -f $fichero.pdf $fichero.html
  13. done
  14.  
  15. chown nobody:desa *
  16. chmod 660 *
  17.  
  18. mv *.pdf /home/datos/compras/muestras/
  19. rm *
  20. rm /home/datos/compras/muestras/prueba.*
That messages just appear sometimes.
Youy might know that files are send to /home/as400/cartas from a IBM iseries using ftp.
Thank you very much for your help!
Oct 11 '07 #1
1 9464
arne
315 Expert 100+
As far as I understand your code, you check if there are files in one folder and if so, invoke the other script which manipulates them.

Did you try
Expand|Select|Wrap|Line Numbers
  1. if [ -z "$(ls /home/as400/muestras)" ]
  2.  
? (Note the additional quotes.)

HTH,
arne
Oct 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
6
by: Derrick | last post by:
Hello all; Since I do have working code, this is more for my curiosity only. I'm creating a "Plugin" architecture, following some of the many examples on the 'net. Basically what I have is...
3
by: Peter Hemmingsen | last post by:
Hi, I'm trying to write a function taking an "flagged" enum as parameter. The function should then loop through the enum and do some stuff for each flag that are set. Below is some sample code...
9
by: Emanuele Aina | last post by:
I have some code which does a lot of "in" on lists containing objects with no __eq__ defined. It all goes fast until I add the __lt__() method: then I have a slowdown comparable to the one I get...
10
by: =?Utf-8?B?RWxlbmE=?= | last post by:
I am surprised to discover that c# automatically converts an integer to a string when concatenating with the "+" operator. I thought c# was supposed to be very strict about types. Doesn't it seem...
10
by: =?Utf-8?B?SmF5QWNoVGVl?= | last post by:
I have a web service written in C# Visual Studio 2005 that calculates splits between two or more timekeepers in a transaction. To set this up I have several decimal data type variables from one...
5
by: Gianni Mariani | last post by:
I'm hoping someone can tell me why using member address of works and why using the dot operator does not in the code below. The code below uses the template function resolution mechanism to...
4
by: pradeep kaltari | last post by:
Hello friends, I have a doubt in the working of IN operator. I have a schema by name 'test_schema'. If you look at the following query the expected output is "1", but nothing is displayed. SELECT...
9
by: erictheone | last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.