From owner-freebsd-questions Fri Sep 6 19:23: 6 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC26E37B400 for ; Fri, 6 Sep 2002 19:23:03 -0700 (PDT) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id B79FF43E65 for ; Fri, 6 Sep 2002 19:23:02 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-b191.otenet.gr [212.205.244.199]) by mailsrv.otenet.gr (8.12.4/8.12.4) with ESMTP id g872Mx7f014484 for ; Sat, 7 Sep 2002 05:23:00 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.6/8.12.6) with ESMTP id g872Dncf029271 for ; Sat, 7 Sep 2002 05:13:49 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.6/8.12.6/Submit) id g872Dm5U029270; Sat, 7 Sep 2002 05:13:49 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 7 Sep 2002 05:13:48 +0300 From: Giorgos Keramidas To: "Henning, Brian" Cc: questions@FreeBSD.ORG Subject: Re: scripting problems Message-ID: <20020907021348.GB24498@hades.hell.gr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Fingerprint: C1EB 0653 DB8B A557 3829 00F9 D60F 941A 3186 03B6 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: "Henning, Brian" wrote: > > i have this shell script that i am having problems with. when i run > it (cat output.txt | xargs sh mycheck_sum.sh) i get an error that > cannot open file. but all the files are there. i am not sure what > the problem is with this script. can someone take a quick look and > tell me if they see anything? > #! /bin/sh -x > # cat output.txt | xargs sh mycheck_sum.sh > > INPUT=$1 > SRC=`echo ${INPUT} | awk -F: '{ print $1 }'` > DST=`echo ${INPUT} | awk -F: '{ print $2 }'` xargs will not pass just one argument at a time to your script: $ cat > lala one two three $ xargs echo < lala one two three $ You will need to handle all the command line arguments that xargs passes to your script with something like: #!/bin/sh for arg in "$@" ;do # handle $arg done -- FreeBSD: The Power to Serve -- http://www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message