This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[UTIL] Perl system does not default to $_
[metaconfig.git] / dist / U / rootid.U
CommitLineData
d8875586
MBT
1?RCS: $Id: rootid.U 1 2006-08-24 12:32:52Z rmanfredi $
2?RCS:
3?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic Licence,
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 Licence; a copy of which may be found at the root
9?RCS: of the source tree for dist 4.0.
10?RCS:
11?RCS: $Log: rootid.U,v $
12?RCS: Revision 3.0.1.1 1995/01/30 14:45:36 ram
13?RCS: patch49: now only prints a single empty line when outputting something
14?RCS:
15?RCS: Revision 3.0 1993/08/18 12:09:42 ram
16?RCS: Baseline for dist 3.0 netwide release.
17?RCS:
18?MAKE:rootid: sed
19?MAKE: -pick add $@ %<
20?S:rootid:
21?S: This variable contains the eventual value of the ROOTID symbol,
22?S: which is the uid of root.
23?S:.
24?C:ROOTID:
25?C: This symbol contains the uid of root, normally 0.
26?C:.
27?H:#define ROOTID $rootid /**/
28?H:.
29: determine root id
30rootid=`$sed -e "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e "q" -e "}" -e "d" </etc/passwd`
31case "$rootid" in
32'') rootid=0 ;;
33*) echo " "; echo "Root uid = $rootid" >&4 ;;
34esac
35