From owner-freebsd-questions@FreeBSD.ORG Sat Jan 31 12:21:08 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 5958016A4CE for ; Sat, 31 Jan 2004 12:21:08 -0800 (PST) Received: from usw2.natel.net (2b.bz [209.152.117.190]) by mx1.FreeBSD.org (Postfix) with SMTP id 0689143D3F for ; Sat, 31 Jan 2004 12:21:07 -0800 (PST) (envelope-from WD@US-Webmasters.com) Received: (qmail 36123 invoked from network); 31 Jan 2004 20:21:05 -0000 Received: from batv-01-048.dialup.netins.net (HELO xyz.US-Webmasters.com) (216.248.109.49) by us-webmasters.com with SMTP; 31 Jan 2004 20:21:05 -0000 Message-Id: <5.1.0.14.2.20040131141609.04f33130@209.152.117.178> X-Sender: wd@209.152.117.178 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 31 Jan 2004 14:20:31 -0600 To: questions@freebsd.org From: "W. D." In-Reply-To: <401B9137.70203@countrypure.net> References: <5.1.0.14.2.20040131035740.07828af0@209.152.117.178> <5.1.0.14.2.20040131035740.07828af0@209.152.117.178> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable cc: Quintin Riis 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 20:21:08 -0000 At 05:27 1/31/2004, Quintin Riis wrote: >In Bourne shell: > >blah=3D$(something | something) >blah2=3D`blah -K 2 -z` > > Quintin Thanks, Quintin! My problem is that when I try to do something like that, I get something like this: Cannot execute using backquotes in safe mode Any other ideas? > >W. D. wrote: >> Hey folks, >>=20 >> Is it possible to redirect text from stdout to a variable? >>=20 >> I do something like this and get the output on the screen: >>=20 >> echo "Some Text to be Encrypted" | /usr/local/bin/gpg -a --always-trust= =20 >--batch --no-secmem-warning -e -u "GPG Tester " -r=20 >"SomeDude@TheDudesDomain.com" >>=20 >>=20 >>=20 >> Most sites advise to do something like this if using PHP: >>=20 >> $cmd =3D "echo $msg | $gpg --batch --no-secmem-warn --armor --home= $home_dir \ >> -u $fm --default-key $fm -r $to --encrypt --sign"; >>=20 >> $message_body =3D `$cmd`; >>=20 >> mail($to,'Web Site Order',$message_body); >>=20 >> However, "safe mode" is on, and won't let me do it. Any ideas? >>=20 >>=20 >>=20 >> Start Here to Find It Fast!=99 ->= http://www.US-Webmasters.com/best-start-page/ >>=20 >> _______________________________________________ >> 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" >>=20 >>=20 >>=20 > >_______________________________________________ >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" >=20 Start Here to Find It Fast!=99 -> http://www.US-Webmasters.com/best-start-pa= ge/