From owner-freebsd-questions@FreeBSD.ORG Fri Sep 8 14:18:11 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 868CF16A4DD for ; Fri, 8 Sep 2006 14:18:11 +0000 (UTC) (envelope-from backyard1454-bsd@yahoo.com) Received: from web83106.mail.mud.yahoo.com (web83106.mail.mud.yahoo.com [216.252.101.35]) by mx1.FreeBSD.org (Postfix) with SMTP id 1D5BD43D45 for ; Fri, 8 Sep 2006 14:18:11 +0000 (GMT) (envelope-from backyard1454-bsd@yahoo.com) Received: (qmail 8316 invoked by uid 60001); 8 Sep 2006 14:18:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=dQomKZ2gOAJpxWVPAsA62a48GTPpuj7a4mHheWKfBhzgrRT0HTW+nbip+mVpHYinlJrfRrlSy1GlO3w6ugLlrPHABVUUbIld1NqPCP1zssqc6kbr05tiS85YOSujzDJO4tQmpLy3+c97G2vttSIUAYodmoDdFStUweujmUjWHTw= ; Message-ID: <20060908141810.8314.qmail@web83106.mail.mud.yahoo.com> Received: from [63.240.228.37] by web83106.mail.mud.yahoo.com via HTTP; Fri, 08 Sep 2006 07:18:10 PDT Date: Fri, 8 Sep 2006 07:18:10 -0700 (PDT) From: backyard To: lassee@kth.se, freebsd-questions@freebsd.org In-Reply-To: <45016BBC.8080803@kth.se> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: How do I give 2 parameters to programs in an unix enviroment? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: backyard1454-bsd@yahoo.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2006 14:18:11 -0000 --- Lasse Edlund wrote: > If I have two files "foo" and "bar" and try to run > diff on them I write: > $diff foo bar > I can also write > $cat foo | diff - bar > But how do I give a program two (2) commands? not > only to diff > but to any program that wants double input... > I wanna do > $cat foo | cat bar | diff - - > especially with echo commands that would be handy so > I dont have to > create files! > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > diff foo bar is the the way a contruct like (cat foo; cat bar| diff - -) may work but I doubt it because they both are writing to the same STDOUT and so "- -" is more then likely invalid. (echo "random junkola" > foo) && (cat foo > bar) or (echo "random junkola" > foo) && (cp foo bar) would be just as good. would echo the same thing to two files. I think what you want might be diff `cat foo` `cat bar` which is the the quote on the tilde key. check man eval if I'm using the right quote this will evaluate the command in the ` ` and pass its STDOUT as a parameter. For large files this might fail because of the limitation to the command line length, I'm not certain. the best thing might be look in /etc/rc for the last line which will be something like: echo `date` those are the quotes you want and this is the only way to do what I think you're asking. -brian