On Tuesday 14 December 2010 13:16:59 Markus Hennecke wrote:
On Tue, 14 Dec 2010, OpenBSD Geek wrote:
I made as I could, since it works, where is the probleme...? ;-)
Tomas already pointed out where this will blow up for sure.
Hint: Take a look at mktemp(1) and install(1) to weed out the
On Dec 14 19:00:53, Leonardo Rodrigues wrote:
Ok! Here goes my contribution to this thread!
# $1=group
# $2=user
cd /etc
cat ./group \
| sed '/'$1'/ s/'$2'//' \
Hm, that's a nice one too: for every line in /etc/group that contains '$1',
remove the first occurence of '$2'. Go on
This must be the most horrible thread ever in terms of scripting and
sh/ksh (ab)use I've ever seen.
Please, folks, don't consider using anything posted in this thread, or
god will start killing kittens.
On 12/14/10 12:31, OpenBSD Geek wrote:
Hi,
After posted many requests on how to remove
Hi,
After posted many requests on how to remove user from a group, i choosed
to build my own script.
And it works very fine.
if [ $1 ] [ $2 ]; then
cp /etc/group /tmp
cat /tmp/group | grep ^$2 /tmp/onlygroup
cat /tmp/group | grep -v ^$2 /tmp/nogroup
cat /tmp/onlygroup | sed s/$1//g | \
On Tue, Dec 14, 2010 at 03:31:40PM +0400, OpenBSD Geek wrote:
Hi,
After posted many requests on how to remove user from a group, i choosed
to build my own script.
And it works very fine.
if [ $1 ] [ $2 ]; then
cp /etc/group /tmp
cat /tmp/group | grep ^$2 /tmp/onlygroup
cat
On Tue, 14 Dec 2010, OpenBSD Geek wrote:
Hi,
After posted many requests on how to remove user from a group, i choosed
to build my own script.
And it works very fine.
if [ $1 ] [ $2 ]; then
cp /etc/group /tmp
cat /tmp/group | grep ^$2 /tmp/onlygroup
cat /tmp/group | grep -v ^$2 /tmp/nogroup
On Tue, Dec 14, 2010 at 12:31 PM, OpenBSD Geek open...@e-solutions.re
wrote:
Hi,
After posted many requests on how to remove user from a group, i choosed
to build my own script.
And it works very fine.
if [ $1 ] [ $2 ]; then
cp /etc/group /tmp
cat /tmp/group | grep ^$2 /tmp/onlygroup
I made as I could, since it works, where is the probleme...? ;-)
You really deserve the Useless Use of Cat Award.
And the race condition award, and the nuke the wrong file award, and...
Kind regards,
Markus
On Tue, 14 Dec 2010, OpenBSD Geek wrote:
I made as I could, since it works, where is the probleme...? ;-)
Tomas already pointed out where this will blow up for sure.
Hint: Take a look at mktemp(1) and install(1) to weed out the worst
issues.
Kind regards,
Markus
On Dec 14 15:31:40, OpenBSD Geek wrote:
Hi,
After posted many requests on how to remove user from a group, i choosed
to build my own script.
And it works very fine.
if [ $1 ] [ $2 ]; then
cp /etc/group /tmp
cat /tmp/group | grep ^$2 /tmp/onlygroup
cat /tmp/group | grep -v ^$2
Ok! Here goes my contribution to this thread!
# $1=group
# $2=user
cd /etc
cat ./group \
| sed '/'$1'/ s/'$2'//' \
| sed '/'$1'/ s/,,/,/' \
| sed '/'$1'/ s/,$//' \
| sed '/'$1'/ s/:,/:/' group.new
mv /etc/group.new /etc/group
chown root.wheel /etc/group
chmod
On Tue, Dec 14, 2010 at 4:00 PM, Leonardo Rodrigues
leonardov...@gmail.com wrote:
mv /etc/group.new /etc/group
chown root.wheel /etc/group
chmod 644 /etc/group
A) root:wheel is better.
B) it's a bad idea to fix the permissions of a file after installing it.
On Tue, Dec 14, 2010 at 10:00 PM, Leonardo Rodrigues
leonardov...@gmail.com wrote:
Ok! Here goes my contribution to this thread!
# $1=group
# $2=user
cd /etc
cat ./group \
| sed '/'$1'/ s/'$2'//' \
| sed '/'$1'/ s/,,/,/' \
| sed '/'$1'/ s/,$//' \
| sed
13 matches
Mail list logo