Try:
sed s/\:1001\:/\:new_GUD\: assign.<timestamp> >assign.whatever
It will go through and replace
:1001:
with
:new_GID:
and write the output to assign.whatever. If you don't redirect the output,
it sends it to the terminal (screen). If this is a huge file, that's
probably not something you want to do as it will be awhile before you can
regain control of the terminal while it dumps the contents of the file to
the screen.
The reason that you would want to include the extra : characters is so that
you doin't inadvertantly nuke one of the usernames that might have 1001 in
it. Just in case you didn't know, you use \ to "escape" the character so
that the command line doesn't try to interpret it. The : means "null" and
is used in shell scripting for "doing nothing" in conditional statements
where you might expect to use a command, like:
if [ some test ]
then
:
else
do something
fi
I'm no sed expert, but this is a fairly simple basic use of it. There may
be someone that can give you something fancier, or perhaps with a little
more error correction, but this is the gist of it, and will work as written.
Of course, don't forget to run qmail-newu after making changes to your
assign file.
-CT
> -----Original Message-----
> From: spoon fork [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 11, 2000 10:52 AM
> To: Dave Sill
> Cc: [EMAIL PROTECTED]
> Subject: Re: deferral:
> Unable_to_switch_to_/home/mailhome/s/simonyjh:_access_denied._
> (#4.3.0)/
>
>
> Hi,
>
> I think I found the problem. In our old machine, the lists of
> users are
> kept in a file assign.<timestamp> in /var/qmail/users. In the old
> system,
> the files look like this (a snapshot):
>
> =0000:alias:1000:1001:/home/mailhome/j/jimmy:::
> =00000:alias:1000:1001:/home/mailhome/0/00000:::
> =007:alias:1000:1001:/home/mailhome/0/007:::
> =007007:alias:1000:1001:/home/mailhome/0/007007:::
> =00ics:alias:1000:1001:/home/mailhome/0/00ics:::
> =00isss:alias:1000:1001:/home/mailhome/0/00isss:::
> =0123:alias:1000:1001:/home/mailhome/0/0123:::
>
> ...
>
> In this case, all users belong to gid 1001, which is the gid of alias.
> The new system (server, I mean) have different gid.
>
> Okay, now I know one potential source(s) of the problem, how do I
> rebuild
> this file?
>
> --mel (they put a young sysad for the job :) )
>