By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,761 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,761 IT Pros & Developers. It's quick & easy.

"too many arguments" message

P: 2
Hi everybody!
My first post here...hope to learn quickly.
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/cartas.sh: line 2: [: too many arguments
This is /home/jmd/sh/cartas.sh:
Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. if [ -z $(ls /home/as400/cartas) ]
  3. then
  4.         echo "" > /dev/null
  5. else
  6.         /home/jmd/sh/cartastxt.sh
  7. fi
And this is /home/jmd/sh/cartastxt.sh
Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. touch /home/as400/cartas/prueba.txt
  3. chown nobody:desa /home/as400/cartas/*
  4. chmod 660 /home/as400/cartas/*
  5. mv /home/as400/cartas/* /home/datos/comercial/cartas/
  6. rm /home/datos/comercial/cartas/prueba.txt
What is driving me crazy is 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
Share this Question
Share on Google+
1 Reply

Motoma
Expert 2.5K+
P: 3,237
You are getting an the error "Too many arguments" on this line:

if [ -z $(ls /home/as400/cartas) ]

What are you trying to do here? What could the message be referring to as arguments?
Oct 12 '07 #2

Post your reply

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