From owner-freebsd-questions Sun Dec 17 20: 0:57 2000 From owner-freebsd-questions@FreeBSD.ORG Sun Dec 17 20:00:54 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from datasphereweb.com (c182500-a.frndl1.wa.home.com [24.10.46.121]) by hub.freebsd.org (Postfix) with SMTP id DA8A237B400 for ; Sun, 17 Dec 2000 20:00:52 -0800 (PST) Received: (qmail 97441 invoked by uid 1000); 18 Dec 2000 04:00:51 -0000 Date: Sun, 17 Dec 2000 20:00:51 -0800 From: David To: Aaron Hill Cc: questions@freebsd.org Subject: Re: Script: Variable substition within a variable? Message-ID: <20001217200051.A97413@datasphereweb.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from hillaa@hotmail.com on Mon, Dec 18, 2000 at 03:53:19AM +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Dec 18, 2000 at 03:53:19AM +0000, Aaron Hill wrote: > Hello! > > Can anyone help with a script problem I'm having. Please let me explain what > I'm trying to do with two example files... > > fileone: > $name > > > filetwo: > #!/bin/sh > > name="Aaron" > fileone=`cat fileone` > > echo "Your name is $fileone" > > > When you execute filetwo this is the output you get: > Your name is $name > > The output I would like to get is: > Your name is Aaron > > > Can anyone point out if I've missed something fundamental or if there's > something that could help me do this substition. I think what you're looking for is something along the lines of: echo "Your name is " $fileone -- |> /\ \/ @ davidd@datasphereweb.com DataSphere - Back end web programming, site security, and networking david.daugherty@netmanage.com Software Engineer NetManage - The Bridge to E-Business http://www.wcug.wwu.edu/~doc ICQ: 21106703 "I like the dreams of the future better than the history of the past" -Thomas Jefferson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message