* SUMMARY: ed editor: 512 bytes per line limit
@ 1996-09-25 13:54 Christophe DIARRA
0 siblings, 0 replies; only message in thread
From: Christophe DIARRA @ 1996-09-25 13:54 UTC (permalink / raw)
To: tru64-unix-managers
Greetings,
Thanks to persons who responded:
Sigismondo Boschi <net1701@comune.bologna.it>
Paul Tyler <pct@lister.anp.ansto.gov.au>
Kurt Carlson <sxkac@java.sois.alaska.edu>
davis@decatl.alf.dec.com
Murthy Hebbar <murthy@dicer.incyte.com>
My apologies if I missed any one who replied
I have the solution to my problem. Alan Davis gave it to me. Following
is his answer:
*************** SOLUTION (From: davis@decatl.alf.dec.com) *************
Christophe,
This is a well-known problem that dates back to Ultrix and
BSD. Here is the workaround :
WORKAROUND:
The workaround is to modify the adduser script to use "awk" instead of "cut"
as follows:
1. For those lines with cut -d: -f4:
change cut to awk
change -d: to -F:
change -f4 to '{print $4}'
2. Also change the ed lines to use sed instead:
# ed /etc/ptmp/group > /dev/null << EOF
# /^${LOGGROUP}:/s/\$/,${USER}/
# g/:,/s//:/
# w
# q
#EOF
sed "/^${LOGGROUP}:/s/\$/,${USER}/" /etc/group | \
sed "/:,/s//:/" > /etc/ptmp/group
3. Also change the following ed lines to use sed instead:
# ed /etc/ptmp/group > /dev/null << EOF
# /^${GROUP}:/s/\$/,${USER}/
# g/:,/s//:/
# w
# q
# EOF
sed "/^${GROUP}:/s/\$/,${USER}/" /etc/group | \
sed "/:,/s//:/" > /etc/ptmp/group
Alan Davis/dusg
********************** END SOLUTION *****************************
My original request was:
> I am using a modified 'adduser' script to add new users under NIS. Now
> I am unable to update the /var/yp/src/group file because I have lines
in this
> file those length are greater than 512 bytes: I have groups with near
> 100 users each. ed is used to process the passwd and group files and now
> ed can't read the group file because of the length of some lines.
>
> Is there a way to solve my problem ? Where can I find a version of ed
> which can process lines greater than 512 bytes ?
>
> Do I need to rewrite my adduser script using an other text editor ?
>
> Thanks in advance.
***
Christophe DIARRA
Institut de Physique Nucleaire
Bat 100 - S2I
91406 ORSAY Cedex
Tel: (16 1) 69 41 65 60
E-mail: diarra@ipno.in2p3.fr
***
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-09-25 13:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-09-25 13:54 SUMMARY: ed editor: 512 bytes per line limit Christophe DIARRA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox