Best way to change a field ina file

Rouben Rostamian rouben at math16.math.umbc.edu
Fri Jun 14 13:13:52 AEST 1991


In article <9735 at cognos.UUCP> maklinm at cognos.UUCP (Maxwell Maklin) writes:
>Sorry, just a novice.  I was wondering what is the preferred way
>to edit a field within a file.  I suppose sed(1V) is the preferred
>choice, but I want to take a file as stdin, change a field and have
>the changed file be place on stdout.  For example, how would one
>change "gcos-field" in the /etc/passwd file?

I suspect that in your message you are not saying what you meant to say,
but if you said what you meant to say, then what you do is:

... [standin here] ... | sed 's/old field/new field/' | ... [standout here] ...

--
Rouben Rostamian                          Telephone: (301) 455-2458
Department of Mathematics and Statistics  e-mail:
University of Maryland Baltimore County   bitnet: rostamian at umbc.bitnet
Baltimore, MD 21228,  U.S.A.              internet: rouben at math9.math.umbc.edu



More information about the Comp.unix.shell mailing list