This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: /etc/profile, mk[passwd|group|group_l_d] messages
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: "Morrison, John" <John dot Morrison at uk dot experian dot com>, cygwin-apps at cygwin dot com
- Date: Thu, 28 Aug 2003 11:26:43 -0400
- Subject: Re: /etc/profile, mk[passwd|group|group_l_d] messages
- References: <CCD084B0E779D411A70300508B66222605A32FE5@exchukahis02.experian.co.uk>
- Reply-to: Pierre dot Humblet at ieee dot org
> Hows this...? (edit inline)
>
> oops, corrected some typos.
Instead of running `id -ng` several times you can hard code the values
(see XXX below)
> case "`id -ng`" in
> mkpasswd )
> echo "Your group is currently \"`id -ng`\". This indicates that"
XXX echo "Your group is currently \"mkpasswd\". This indicates that"
> echo "the /etc/passwd (and possibly /etc/group) files should be rebuilt."
> echo "See the man pages for mkpasswd and mkgroup then, for example, run"
> echo "mkpasswd -l [-d] > /etc/passwd"
> echo "mkgroup -l [-d] > /etc/group"
> echo "as appropriate. Note that the -d switch is necessary for"
> echo "domain users." ;;
> mkgroup )
> echo "Your group is currently \"`id -ng`\". This indicates that"
XXX ditto
> echo "the /etc/group (and possibly /etc/passwd) files should be rebuilt."
> echo "See the man pages for mkpasswd and mkgroup then, for example, run"
> echo "mkpasswd -l [-d] > /etc/passwd"
> echo "mkgroup -l [-d] > /etc/group"
> echo "as appropriate. Note that the -d switch is necessary for"
> echo "domain users." ;;
> mkgroup_l_d )
> echo "The /etc/group file doesn't contain the domain groups."
> echo "See the man page for mkgroup and then, for example, run"
> echo "mkgroup -l -d > /etc/group"
> echo "as appropriate."
XXX echo "Your group name is currently \"mkpasswd_l_d\". This indicates that not all"
XXX echo "domain users and groups are listed in the "/etc/passwd and /etc/group files."
XXX echo "See the man pages for mkpasswd and mkgroup then, for example, run"
XXX echo "mkpasswd -l [-d] > /etc/passwd"
XXX echo "mkgroup -l [-d] > /etc/group"
> echo
> echo "You can safely ignore this message"
XXX echo "This message is only displayed once and can be safely ignored."
> # only display the above once
> cat /etc/group | sed -e 's/mkgroup_l_d/mkgroup-l-d/g' >
> /etc/group.new mv /etc/group /etc/group.mkgroup_l_d
> mv /etc/group.new /etc/group
Let's make it fail safe, avoid invoking cat and set the mode
sed -e 's/mkgroup_l_d/mkgroup-l-d/' /etc/group > /etc/group.new \
&& mv /etc/group /etc/group.mkgroup_l_d
&& (mv /etc/group.new /etc/group || mv /etc/group.mkgroup_l_d /etc/group ; )
chmod a+r /etc/group
rm -f /etc/group.mkgroup_l_d
Pierre