how to remove specific lines from a file (reprise)

Hello,

I've to change the shell in /etc/passwd for some users .
I've the list of users but I'm not able to modify the file with scripting .
I'm working on a Sol10 .

Can anyone help me ?

tnks

Show us your script.

Have you tried using the passwd -e option?

it's a foreach cicle

foreach i {`cat list`}
sed "|$i|s|/bin/ksh|/compte_bloque|" /etc/passwd >> /etc/passwd.new
end

Edit: I think I hit post reply too soon. Given the subject and the original requirement ... what's the problem?

Sorry,
I don't understand awk solution . More over, I obtain an error :

awk: (FILENAME=list FNR=1) fatal: attempt to use array `u' in a scalar context

thanks for yours reply

The error is strange,
could you post the entire input/ouput: commands + output?

argh, it was a digit mistake !!!
!!!!! IT WORKS !!!!!!

tnks a lot

...te sposerei :smiley: