~ubuntu-branches/ubuntu/hardy/autoconf-archive/hardy

« back to all changes in this revision

Viewing changes to htmldoc/ac_check_user.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2004-06-26 09:43:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040626094357-3be3jwcz1vcdhpe8
Tags: upstream-20040616
ImportĀ upstreamĀ versionĀ 20040616

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
 
2
"http://www.w3.org/TR/html4/strict.dtd">
 
3
 
 
4
<html lang="en">
 
5
<head>
 
6
  <title>Autoconf Macro: ac_check_user</title>
 
7
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
 
8
</head>
 
9
 
 
10
<body>
 
11
  <table summary="web navigation" style="width:100%;">
 
12
    <tbody>
 
13
      <tr>
 
14
        <td style="width:50%;" align="center">[<a href="index.html">Macro Index
 
15
        Page</a>]</td>
 
16
 
 
17
        <td style="width:50%;" align="center">[<a href=
 
18
        "../m4source/ac_check_user.m4">Download M4 Source</a>]</td>
 
19
      </tr>
 
20
    </tbody>
 
21
  </table>
 
22
  <hr>
 
23
 
 
24
  <h1>ac_check_user</h1>
 
25
 
 
26
  <h2>Synopsis</h2>
 
27
 
 
28
  <div class="indent">
 
29
    <p style="text-align:left; white-space:nowrap;">
 
30
    <code>AC_CHECK_USER</code></p>
 
31
  </div>
 
32
 
 
33
  <h2>Description</h2>
 
34
 
 
35
  <div class="indent">
 
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>
 
38
 
 
39
    <p>Example:</p>
 
40
    <pre>
 
41
    AC_CHECK_USER(USER, [gleensalmon])
 
42
    if test x$USER = xgleensalmon; then
 
43
        bla..bla..bla..
 
44
    else
 
45
        bla..bla..bla..
 
46
    fi
 
47
</pre>
 
48
 
 
49
    <p>Besides checking existence, this macro also set these environment
 
50
    variables upon completion:</p>
 
51
    <pre>
 
52
    USER_HOME = home directory of user, written in /etc/passwd
 
53
</pre>
 
54
  </div>
 
55
 
 
56
  <h2>Version</h2>
 
57
 
 
58
  <div class="indent">
 
59
    <p>1.2 (last modified: 2002-04-11)</p>
 
60
  </div>
 
61
 
 
62
  <h2>Author</h2>
 
63
 
 
64
  <div class="indent">
 
65
    <p>Gleen Salmon &lt;gleensalmon@yahoo.com&gt;</p>
 
66
  </div>
 
67
 
 
68
  <h2>M4 Source Code</h2>
 
69
 
 
70
  <div class="indent">
 
71
    <pre class="m4source">
 
72
AC_DEFUN([AC_CHECK_USER],[
 
73
AC_MSG_CHECKING([for user $2])
 
74
if grep ^$2: /etc/passwd &gt; /dev/null; then
 
75
        $1=$2
 
76
        USER_HOME=`grep ^$2: /etc/passwd | sed "s/^\([[^:]]*:\)\{5\}\([[^:]]*\):[[^:]]*$/\2/"`
 
77
        AC_MSG_RESULT([yes])
 
78
else
 
79
        unset $1
 
80
        unset USER_HOME
 
81
        AC_MSG_RESULT([no])
 
82
fi;dnl
 
83
])
 
84
</pre>
 
85
  </div>
 
86
 
 
87
  <h2>Copyright</h2>
 
88
 
 
89
  <div class="indent">
 
90
    <a href="COPYING.html">GNU General Public License</a> with this special
 
91
    <a href="COPYING-Exception.html">exception</a>.
 
92
  </div>
 
93
</body>
 
94
</html>