Article View: es.comp.os.linux.programacion
Article #10358[bash] test: too many arguments
From: Benjamín Albiñana
Date: Fri, 01 Mar 2002 20:37
Date: Fri, 01 Mar 2002 20:37
45 lines
2470 bytes
2470 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Estoy intentando hacer un script en bash que mire si hay ficheros en un directorio, y si es as�, que los mueva a otro, y los pase por otro script. Una vez hecho esto, que lance un programa. - ----------------------------------------------------------------------- #!/bin/bash if test ! -z $(dir -1 /var/spool/news/failed.postings/) then mv /var/spool/news/failed.postings/* /var/spool/news/out.going cd /var/spool/news/out.going for i in $(dir -1) do /usr/local/bin/toqueteo $i done fi cd /tmp su -c "/usr/sbin/fetchnews -nvvv" news - ----------------------------------------------------------------------- El caso es que me da el siguiente error: sh -x noticias4 ++ dir -1 /var/spool/news/failed.postings/ + test '!' -z 17626-1014994423-1 17626-1014995334-2 17626-1014995688-3 17626-1014996193-4 noticias4: test: too many arguments Llevo un par de d�as dandole vueltas, y no soy capaz de ver d�nde est� el problema. �Alguna idea? - -- Benjam�n Albi�ana P�rez http://www.escomposlinux.org/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8f+Z0633hg168lHwRAuPvAKCCNDyVgliCwiMxLMne+KrI+mb2nACgwM0c lHkGSs33eB5ezQKnr/M1gMc= =tVHM -----END PGP SIGNATURE-----
Technical Details
Message-ID:
<slrna7vpjf.mlg.benjamin@lamanonegra.net.dhis.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ber1.dfn.de!fu-berlin.de!uni-berlin.de!217-127-137-188.uc.nombres.ttd.ES!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,f967119e962785f0,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-03-01 13:04:33 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ber1.dfn.de!fu-berlin.de!uni-berlin.de!217-127-137-188.uc.nombres.ttd.ES!not-for-mail From: Benjamín Albiñana <benjamin@lamanonegra.net.dhis.org> Newsgroups: es.comp.os.linux.programacion Subject: [bash] test: too many arguments Date: Fri, 1 Mar 2002 21:37:09 +0100 Organization: Something completely different Lines: 45 Message-ID: <slrna7vpjf.mlg.benjamin@lamanonegra.net.dhis.org> Reply-To: benalb@escomposlinux.org NNTP-Posting-Host: 217-127-137-188.uc.nombres.ttd.es (217.127.137.188) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1015016669 9595364 217.127.137.188 (16 [31308]) X-Orig-Path: 127.0.0.1!nobody User-Agent: slrn/0.9.7.3 (Linux)