From owner-freebsd-questions@FreeBSD.ORG Sat Jan 31 03:30:14 2004 Return-Path: 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 9A6C416A4CE for ; Sat, 31 Jan 2004 03:30:14 -0800 (PST) Received: from server945.gisol.com (server945.gisol.com [207.44.208.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52CFB43D39 for ; Sat, 31 Jan 2004 03:30:13 -0800 (PST) (envelope-from webmaster@countrypure.net) Received: from 216-229-72-42-dialup-mo.fidnet.com ([216.229.72.42] helo=countrypure.net) by server945.gisol.com with asmtp (Exim 4.24) id 1AmtK9-000706-Q7; Sat, 31 Jan 2004 03:30:08 -0800 Message-ID: <401B9137.70203@countrypure.net> Date: Sat, 31 Jan 2004 05:27:51 -0600 From: Quintin Riis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "W. D." References: <5.1.0.14.2.20040131035740.07828af0@209.152.117.178> In-Reply-To: <5.1.0.14.2.20040131035740.07828af0@209.152.117.178> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server945.gisol.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - countrypure.net cc: questions@freebsd.org Subject: Re: Redirect text from stdout to a variable? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 11:30:14 -0000 In Bourne shell: blah=$(something | something) blah2=`blah -K 2 -z` Quintin W. D. wrote: > Hey folks, > > Is it possible to redirect text from stdout to a variable? > > I do something like this and get the output on the screen: > > echo "Some Text to be Encrypted" | /usr/local/bin/gpg -a --always-trust --batch --no-secmem-warning -e -u "GPG Tester " -r "SomeDude@TheDudesDomain.com" > > > > Most sites advise to do something like this if using PHP: > > $cmd = "echo $msg | $gpg --batch --no-secmem-warn --armor --home $home_dir \ > -u $fm --default-key $fm -r $to --encrypt --sign"; > > $message_body = `$cmd`; > > mail($to,'Web Site Order',$message_body); > > However, "safe mode" is on, and won't let me do it. Any ideas? > > > > Start Here to Find It Fast!™ -> http://www.US-Webmasters.com/best-start-page/ > > _______________________________________________ > 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" > > >