From owner-freebsd-questions Sun Feb 7 16:43:05 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA13991 for freebsd-questions-outgoing; Sun, 7 Feb 1999 16:43:05 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from isis.dynip.com ([139.141.220.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA13850 for ; Sun, 7 Feb 1999 16:42:27 -0800 (PST) (envelope-from root@isis.dynip.com) From: root@isis.dynip.com Received: (from root@localhost) by isis.dynip.com (8.9.2/8.9.1) id DAA21348; Mon, 8 Feb 1999 03:41:47 +0300 (AST) (envelope-from root) Message-Id: <199902080041.DAA21348@isis.dynip.com> Date: Mon, 8 Feb 1999 03:41:47 +0300 (AST) Reply-To: root@isis.dynip.com Subject: Re: Help About Shell Script To: ben@scientia.demon.co.uk cc: freebsd-questions@FreeBSD.ORG In-Reply-To: <19990207213957.A1306@scientia.demon.co.uk> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 7 Feb, Ben Smithurst wrote: > Please remember to cc all replies to the mailing list. Sorry. >> What if we wanted to tke the variables i and j >> from a file. > > That would depend what format the file was. At the simplest level, with > two files called "current_i" and "current_j", containing the numbers > alone, you can read that like so: > > i=$(cat current_i) > j=$(cat current_j) That's too simple, but kinda reduntant, they are actually 4 loops inside one-another, can't think of creating 4 files each containing an integer, this won't be programming, its carpenting. > If the file contains something like > > i=5 > j=18 > > you could probably do > > eval $(cat name_of_the_file) did not get this one, you mean ; i= $(cat name_of_the_file) ??? if that's what you mean, then you solved my problem. > I'd recommend using Perl if you go much more complex. Ya, That's aa coooool thing to learn, I have seen what perl scripts can do. But I think its very extensible language, I mean I'll be 65 years before I reach the bottom of it, is that so, I'm ready to learn new things, and always wish to learn the devls such as perl, tcl, tk, but I'm kinda afraid that they'd be difficult for me to learn. Thanks very much for your replies, see ya soon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message