1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
"http://www.w3.org/TR/html4/strict.dtd">
6
<title>Autoconf Macro: ac_check_user</title>
7
<link rel="stylesheet" type="text/css" href="ac-archive.css">
11
<table summary="web navigation" style="width:100%;">
14
<td style="width:50%;" align="center">[<a href="index.html">Macro Index
17
<td style="width:50%;" align="center">[<a href=
18
"../m4source/ac_check_user.m4">Download M4 Source</a>]</td>
24
<h1>ac_check_user</h1>
29
<p style="text-align:left; white-space:nowrap;">
30
<code>AC_CHECK_USER</code></p>
36
<p>Check if the specified UNIX user exists, if yes set your environment
37
variable to that username else unset your environment variable</p>
41
AC_CHECK_USER(USER, [gleensalmon])
42
if test x$USER = xgleensalmon; then
49
<p>Besides checking existence, this macro also set these environment
50
variables upon completion:</p>
52
USER_HOME = home directory of user, written in /etc/passwd
59
<p>1.2 (last modified: 2002-04-11)</p>
65
<p>Gleen Salmon <gleensalmon@yahoo.com></p>
68
<h2>M4 Source Code</h2>
71
<pre class="m4source">
72
AC_DEFUN([AC_CHECK_USER],[
73
AC_MSG_CHECKING([for user $2])
74
if grep ^$2: /etc/passwd > /dev/null; then
76
USER_HOME=`grep ^$2: /etc/passwd | sed "s/^\([[^:]]*:\)\{5\}\([[^:]]*\):[[^:]]*$/\2/"`
90
<a href="COPYING.html">GNU General Public License</a> with this special
91
<a href="COPYING-Exception.html">exception</a>.