Korn Tilde expansion

Philippe Leclercq leclercq at bachus.enet.dec.com
Tue Feb 5 20:05:25 AEST 1991


Path: bachus.enet.dec.com!leclercq
Newsgroups:
sussex.general,comp.sys.sequent,comp.unix.questions,comp.unix.misc,comp.
.unix.admin
Distribution: world
References: <4401 at syma.sussex.ac.uk> 
From: leclercq at bachus.enet.dec.com (Philippe Leclercq)
Message-ID: <1991Feb5.100042 at bachus.enet.dec.com>
Reply-To: leclercq at bachus.enet.dec.com (Philippe Leclercq)
Organization: Digital Equipment Corporation
Subject: Re: Korn Tilde expansion
Keywords: korn tilde

In article <4401 at syma.sussex.ac.uk>, stevedc at syma.sussex.ac.uk (Stephen Carter)
writes:
|> 
|> Sequent Dynix - Korn Shell tilde (~) expansion
|> ----------------------------------------------
|> 
|> In trying to write a (very naive) script on my Sequent Symmetry running
|> Dynix 3.0.17 we have run into a problem on tilde expansion.
|> 
|> We want to allow the operators the option of entering (eg)
|> ~stevec/foo.txt instead of having to enter
|> /user3/division/section/stevec/foo.
|> 
|> However, try as we may, we cannot get the following logic (or a wide
|> range of variants of it to work:
|> 
|> #!/bin/ksh
|> #       .
|> #       .  cuts here to make it shorter
|> 
|> echo "  from  (eg /user2/pers/artemish/wp1/file1.txt) : \c"
|> read from
|> echo "  to    (eg /user2/pers/elinorm/wp1/file1.txt)  : \c"
|> read to
|> echo "  new owner (eg elinorm)   		      : \c"
|> 
|> #	More cuts (eg testing access/ to file not existing etc)
|> 
|>         mv $from $to
|> 
|> We have tried it with and without single quotes, double quotes, curly
|> brackets... 
|> 
|> Question:  Can it be done?  If so how?  If not on Dynix, then is this
|> inability a 'feature' of Dynix.
|> 
|> Thanks
|> 

We have the same behavior on ULTRIX.
Substitute your last command by :

eval "mv $from $to"

It should work.

-Philippe Leclercq
  Support System Engineer
   DEC Brussels, Belgium.



More information about the Comp.unix.questions mailing list