Date: Mon, 8 Feb 1999 17:00:35 +0000 From: Ben Smithurst <ben@scientia.demon.co.uk> To: root@isis.dynip.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help About Shell Script Message-ID: <19990208170035.B13705@scientia.demon.co.uk> In-Reply-To: <199902080041.DAA21348@isis.dynip.com> References: <19990207213957.A1306@scientia.demon.co.uk> <199902080041.DAA21348@isis.dynip.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990208170035.B13705>