DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
Old 5th June 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Well, in all fairness 70-80% of the changes that have happened in the user land since early UNIX, were either by people who wanted to add them or got paid to lol.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 5th June 2008
tanked tanked is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 56
Default

Sorry for the hijack

I swear to God, I must be blind, I genuinely cannot see the man page text that BSDKaffee posted, I've ran a word search in Firefox on the online manual page and I cannot find the text BSDKaffee quoted- can you point out to me the exact wording in the man page?
Reply With Quote
Old 5th June 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

I apologize for dragging this thread more off-topic, but now I am becoming very curious. I don't see the option you all are referring to either. I searched the manpages for pw(8) for both '-d' and 'oldmembers' -- no dice.

Code:
> uname -rms
FreeBSD 6.3-RELEASE-p1 i386
__________________
Kill your t.v.
Reply With Quote
Old 5th June 2008
tanked tanked is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 56
Default

Quote:
Originally Posted by anomie View Post
I apologize for dragging this thread more off-topic, but now I am becoming very curious. I don't see the option you all are referring to either. I searched the manpages for pw(8) for both '-d' and 'oldmembers' -- no dice.

Code:
> uname -rms
FreeBSD 6.3-RELEASE-p1 i386
So I'm not going crazy

Also as I said before, the command that BSDKaffee gave me:

Code:
pw groupmod group -d username
does not work and returns the following:

Code:
pw: illegal option -- d
pw: unknown switch
Reply With Quote
Old 5th June 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

Ok, I apologize. I didn't realize how new the option was (it was commited in February. It is in 7.0-STABLE, however, which is what I am using.

As a cop out I made this script to remove a specified user from a specified group:
Code:
#!/bin/sh

# Remove a user from a group
# Usage: groupmod.sh <groupname> <username>
# Use only one group and one user at a time...multiple users could be done from another script

GROUP=$1
USER=$2
PW=/usr/sbin/pw
SED=/usr/bin/sed
 
if [ -z "$1" ]
then
	echo "Oops! You forgot to specify the Group."
	exit 1
fi
if [ -z "$2" ]
then
	echo "Oops! You forgot to specify the Username."
	exit 1
fi

# Show existing users in the group and use sed to remove them from the list
NEWMEMBERS=`${PW} groupshow ${GROUP} -P | ${SED} -e '1d' -e 's|^[ \t]*||' -e 's|Members: ||' -e "s|${USER}||g" -e 's|,$||'`
# Feed pw the list of users that were in the group minus the deleted user
${PW} groupmod ${GROUP} -M ${NEWMEMBERS}
Reply With Quote
Old 5th June 2008
tanked tanked is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 56
Default

I thought you may have been running a more bleeding edge version so I looked at the on-line pw man page for -STABLE and -CURRENT but its not in there either, the on-line man pages must not have been updated yet.

So the answer to my original question is to edit /etc/group, use the script you've provided (thanks for that) or update to -STABLE. Ah well, mystery solved.
Reply With Quote
Old 5th June 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Default

Hmm... I was misreading my manpage... the entry I was refering to was for adding a user to a group... strange.

uname -r
7.0-RELEASE-p1
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opera Port - conflicting pkgs in "make install" IronForge OpenBSD Packages and Ports 5 29th October 2009 05:10 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM
Newbie-friendly "printing in OpenBSD" guide wanted Shagbag OpenBSD Packages and Ports 5 7th July 2008 09:26 PM


All times are GMT. The time now is 03:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick