passing command line arguments to awk

Dave Esan de at moscom.UUCP
Sat Sep 20 02:01:30 AEST 1986


> 
> I surrender  --  is it possible to pass command line arguments to awk?
> 
> If so - how.  While I'm at it how about doing the same thing to sed.

I don't use awk that much, but I'm sure its possible.  As for sed:

Suppose that you want to substitute A for B.  Your command could be:    

(executable file) A B, where executable file contains the line:
       
	sed "s/$1/$2/" editingfilename.

There are many other combinations, which of course is the wonder that is
UN*X.

               rochester \
David Esan                | moscom ! de
                    ritcv/



More information about the Comp.unix mailing list