From owner-freebsd-questions Mon Feb 8 10:26:11 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA08516 for freebsd-questions-outgoing; Mon, 8 Feb 1999 10:26:11 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA08510 for ; Mon, 8 Feb 1999 10:26:07 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.11 #1) id 109u31-0003aM-00; Mon, 8 Feb 1999 17:00:35 +0000 Date: Mon, 8 Feb 1999 17:00:35 +0000 From: Ben Smithurst To: root@isis.dynip.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help About Shell Script Message-ID: <19990208170035.B13705@scientia.demon.co.uk> References: <19990207213957.A1306@scientia.demon.co.uk> <199902080041.DAA21348@isis.dynip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <199902080041.DAA21348@isis.dynip.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG root@isis.dynip.com wrote: > 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. Well it is a shell script, you can't expect much :-) >> 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. No, ``eval $(cat name_of_the_file)''. First, the shell runs the command within $(), so you have ``eval i=5 j=18'', then the eval will set those variables for you. (The spacing of the file doesn't matter, since white space as normal is ignored by the shell, so you could put all the variables on one line.) > 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, Not really. Well, maybe it will take a while to learn it all, but you should be able to learn the basics fairly quickly. As Patrick said, get a copy of the Camel from Amazon or your local book shop, Perl is a fairly easy language to learn. > 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. I haven't learnt anything about Tcl or Tk yet. sigh... more things to learn, I need to learn something about writing programs for X at some point as well. -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message