Korn Tilde expansion

Stephen Carter stevedc at syma.sussex.ac.uk
Tue Feb 5 00:47:25 AEST 1991



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.

(Dynix is basically Berlekly Unix with an
application level System V sitting on top).  For those readers who know
Dynix we are using SVAE.

The script merely eases the problems of the operators in moving files
from one user's account to another, and then remembering to change the
ownership and group.  It asks for 4 parameters in turn (from, to,
newowner and newgroup).

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

Stephen Carter, Systems Manager, The Administration,
The University of Sussex, Falmer, Brighton BN1 9RH, UK
Tel: +44 273 678203  Fax: +44 273 678335     JANET: stevedc at uk.ac.sussex.syma
EARN/BITNET  : stevedc at syma.sussex.ac.uk      UUCP: stevedc at syma.uucp
ARPA/INTERNET: stevedc%syma.sussex.ac.uk at nsfnet-relay.ac.uk 



More information about the Comp.unix.questions mailing list