From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <44842>; Tue, 23 Oct 2001 14:15:27 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15vzyc-0003NR-00 for rc@hawkwind.utcs.toronto.edu; Tue, 23 Oct 2001 12:44:10 +0100 Received: (qmail 24254 invoked from network); 23 Oct 2001 11:44:31 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 23 Oct 2001 11:44:31 -0000 Date: Tue, 23 Oct 2001 07:44:31 -0500 Message-ID: <20011023114431.3825.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: carlos@scriptaworks.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20011023085557.A16410@texne.com> (carlos@scriptaworks.com) Subject: Re: Beta release rc-1.6b3 available References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> > Mine is not really a bug report, buth rather a request for a new > feature. I dunno whether it has been asked before on this list, but Trust me: it has been asked before :-). > are there any chances that rc will ever handle [tilde expansion ?] Probably not. Before it could happen, we would need: i) somebody to figure out how tilde expansion can co-exist with rc's existing interpretation of tilde; OR ii) somebody to persuade the tilde expanders of an alternate syntax they are happy with. Note that if you can twist option ii) far enough, rc *already* has tilde expansion :-). ; fn h {if(~ () $1){echo $home}else perl -le 'print ((getpwnam('^$1^'))[7])'} ; echo `h /h/tjg ; echo `{h games} /usr/games You should be horrified at the use of Perl here, so compile the program below as `homedir', and use: ; fn h {if(~ () $1){echo $home}else homedir $1} Cheers, Tim. #include #include #include int main(int argc, char **argv) { if (argv[1]) { struct passwd *p = getpwnam(argv[1]); if (p) puts(p->pw_dir); } }