Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Feb 1999 03:41:47 +0300 (AST)
From:      root@isis.dynip.com
To:        ben@scientia.demon.co.uk
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Help About Shell Script
Message-ID:  <199902080041.DAA21348@isis.dynip.com>
In-Reply-To: <19990207213957.A1306@scientia.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902080041.DAA21348>