www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/05/14:46:49

X-Authentication-Warning: kendall.sfbr.org: jeffw set sender to jeffw AT darwin DOT sfbr DOT org using -f
Date: Fri, 5 Jan 2001 13:42:03 -0600
From: JT Williams <jeffw AT darwin DOT sfbr DOT org>
To: djgpp AT delorie DOT com
Subject: shell trickery
Message-ID: <20010105134203.A12998@kendall.sfbr.org>
Mail-Followup-To: djgpp AT delorie DOT com
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
Reply-To: djgpp AT delorie DOT com

A shell-related question:

% echo '$BASE/foo/bar' > tmpfile
% cat tmpfile
$BASE/foo/bar
% export BASE=/home
% ls `cat tmpfile`
ls: $BASE/foo/bar: No such file or directory
% set `cat tmpfile`
% ls $@
ls: $BASE/foo/bar: No such file or directory

I've tried this (and *many* other variations which I
will not repeat here) with bash-2.04 under djgpp 2.03.

Is there some shell trickery to get the variable `$BASE'
(written as such in `tmpfile') to be expanded when it is
presented as the argument to `ls', `cd', etc?

-- 
TIA/jtw

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019