From owner-freebsd-questions@FreeBSD.ORG Sat Jan 31 02:05:37 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 565ED16A4CE for ; Sat, 31 Jan 2004 02:05:37 -0800 (PST) Received: from usw2.natel.net (2b.bz [209.152.117.190]) by mx1.FreeBSD.org (Postfix) with SMTP id 0D95143D39 for ; Sat, 31 Jan 2004 02:05:36 -0800 (PST) (envelope-from WD@US-Webmasters.com) Received: (qmail 12934 invoked from network); 31 Jan 2004 10:05:33 -0000 Received: from batv-01-049.dialup.netins.net (HELO xyz.US-Webmasters.com) (216.248.109.50) by us-webmasters.com with SMTP; 31 Jan 2004 10:05:33 -0000 Message-Id: <5.1.0.14.2.20040131035740.07828af0@209.152.117.178> X-Sender: wd@209.152.117.178 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 31 Jan 2004 04:04:57 -0600 To: questions@freebsd.org From: "W. D." Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: 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 10:05:37 -0000 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 =3D "echo $msg | $gpg --batch --no-secmem-warn --armor --home $home_dir= \ -u $fm --default-key $fm -r $to --encrypt --sign"; $message_body =3D `$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!=99 -> http://www.US-Webmasters.com/best-start-pa= ge/