[PLUG] RE: shell scripting problem
D. Cooper Stevenson
cooper at linux-enterprise.net
Fri Jun 7 14:40:29 UTC 2002
> On Thu, 2002-06-06 at 17:52, Matt Alexander wrote:
>
>
> > I have about 200 names in /etc/group that I want to remove. They're
all
> > under a generic "users" group.
>
Here's your script. Change the variables accordingly:
#************************Cut Here******************************
#!/bin/bash
group_file=/tmp/group
output_file=/tmp/group.out
name_file=/tmp/names
cat $name_file | while read name
do
sed -e s/:$name// -e s/,$name// -e s/,$name,/,/ -e /$name/d
$group_file > $output_file
done
#*********************End Script******************************
-Cooper
More information about the PLUG
mailing list