Can someone please help with a script I'm writing...

Can someone please help with a script I'm writing...

Post by twelvt.. » Wed, 18 Apr 2001 01:49:27

Hello all,

I am currently working on a script to clean NIS netgroup.

What I am trying to do is compile a list of entries found in NIS netgroup, but
not in NIS hosts or passwd.

It's no problem for me to compare the list against hosts or passwd, but I'm
having extreme difficulty with compiling the list to begin with.

First and foremost, I wasn't able to ypcat netgroup since it displays as one
continuous line.  In turn, I have to cat the netgroup file.

Next, the netgroup contains groupnames, usernames, hosts and domains, that are
separated by tabs, spaces and various bracket and comma entries.  It's all
so confusing!!!

Example of an entry:

groupname    (,username,) (,username,) (hostname,,)
(hostname,,) (,,domainname)

Using the 'awk' command, I was able to compile 3 separate lists containing
usernames, hostnames and domainnames... but I am still stuck with a list
that contains the groupname and specific entries with the bracket and comma

I tried using 'cut' to get rid of the groupname first (because I don't need it),
but it doesn't cut uniformly for other groupname entries on the list.

Also, if I am finally able to eliminate the groupname, I need to get rid of
the brackets and commas.  After that, I will need to move the entries into
one column.  I don't know how to do that.

I'm trying to get the following steps.

From above example (already separated by each list):

groupname     (,username,) (,username,)


(,username,) (,username)


username username



* The same will apply to the other netgroup entries for hostnames and

I'm quite new to scripting, so if any scripting guru can help me out, I'd
greatly appreciate it.

Thanks a whole bunch!


1. please, oh please, someone help me, i'm really stuck

long ago i had linux on a 486, now i have replaced that machine but i
got another 486 sx/33 that i want to put linux on.  there are no special
devices, one 3.5 floppy, one 270 meg ide hd, one 14.4 modem, thats it.
i'm using bare.i as the boot disk and color.gz as the root disk
(although i never get to the root disk part).
when i boot the machine with the boot disk in the floppy drive, it gives
the LILO message, then gives a prompt.  it says DO NOT CHANGE DISKS
YET.  this prompt is only for extra parameters.  well the last time i
did this (long ago) i just pressed enter and had no prob.  Now, no
matter what i enter here or even if i press nothing, it gives me a whole
screen full of gibberish and some errors
the following is an excerpt from this screen, can someone help me figure
out why this won't just boot through like slackware did for me the first
time?  btw, the first screen says it is 3.4.0.

Now booting kernal
probing pci hardware.
invalid operand: 0000
cpu: 0
eip: 0010:[<00000007>]
eflags: 00010096
eax: 0000b108 ebx:00000000 ecx:00000000 edx:00000000
esi: 001d80a8 edi: 00000012 ebp:0021af3c esp: 001da968
ds: 0018 es: 0018 fs: 0018 gs: 0018 ss: 0018
Process swapper (pid: 0, process nr: 0, stackpage=001d8a2c)
stack:  0010e007 00000010 008000000009e000 0021af58 00000000 00000046
           00000000 00000000 0000000e 001da9db 00800000 001b63a4
00000000 00000000
           0000000e 001da9db 00800000 0009e000 0021af58 001da9f0
001139de 00000000
call trace: [<0010e007>] [<00800000>] [<0010e8f4>] [<00800000>]
[<001b63a4>] [<00800000>] [<001139de>] [<001b66f2>] [<00109118>]
[<00800000>] [<00800000>]
code: f0 c3 e2 00 f0 6d e3 ff ff ff ff 00 f0 54 ff 00 f0 6d e3 00
kfree of non-kmalloced memory: 001daa74, next= 00000000, order = 0
kfree of non-kmalloced memory: 001daa64, next= 00000000, order = 0
kfree of non-kmalloced memory: 001daf78, next= 00000000, order = 0
idle task may not sleep
idle task may not sleep
idle task may not sleep
idle task may not sleep
idle task may not sleep
at that point it just hangs and after about 12-15 minutes the screen
blanks out
does this make any sence to anyone?
PLEASE, PLEASE, PLEASE someone shed some light on this for me.
i would most appreciate it if any responce could be routed to

thank you so much for all your time and attention
Mike Bailey

2. Domain name point to a port?

3. Can't start LPD...Someone please help!

4. USR 16.8 and dialin's


6. arguments to xlC (shared libraries)

7. Someone please write this FAQ

8. process in D!

9. Want to hire someone to write me three scripts

10. ksh scripted sed needs a control J - but I can't write the script!

11. Could someone please send me a 'lock' source code?

12. Help in writing script for extracting tar files, please!

13. write auto-ftp please