1 ?RCS: $Id: Filexp.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: $Log: Filexp.U,v $
12 ?RCS: Revision 3.0.1.2 1994/10/29 15:52:53 ram
13 ?RCS: patch36: added ?F: line for metalint file checking
14 ?RCS: patch36: added HOME to the ?T: line since metalint now checks ${HOME}
16 ?RCS: Revision 3.0.1.1 1994/05/06 14:03:00 ram
17 ?RCS: patch23: made sure error status from csh is propagated (WED)
19 ?RCS: Revision 3.0 1993/08/18 12:04:53 ram
20 ?RCS: Baseline for dist 3.0 netwide release.
23 ?X: This unit produces a shell script which will expand filenames beginning
24 ?X: with tildes. The script is deleted at the end of Configure.
26 ?MAKE:Filexp: startsh sed test expr eunicefix
27 ?MAKE: -pick add $@ %<
29 ?T:HOME LOGDIR dir me name failed
30 : set up shell script to do ~ expansion
36 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
39 if $test -f /bin/csh; then
40 /bin/csh -f -c "glob \$1"
45 name=\`$expr x\$1 : '..\([^/]*\)'\`
46 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
47 if $test ! -d "\$dir"; then
49 echo "\$me: can't locate home directory for: \$name" >&2
54 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`