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
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
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'.
On Tue, Dec 14, 2010 at 10:00 PM, Leonardo Rodrigues
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 '/'$1'/ s/:,/:/' >
On Tue, Dec 14, 2010 at 4:00 PM, Leonardo Rodrigues
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.
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 64
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
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
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, Dec 14, 2010 at 12:31 PM, 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/gro
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/nogro
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
> ca
12 matches
Mail list logo