On Mar 10, 2:32=A0pm, Ed Morton <mor...@[EMAIL PROTECTED]
> wrote:
> On 3/10/2008 1:13 AM, happytoday wrote:
>
> > I am piping sed command to an awk program but I got that error
> > message :
> > # =A0sed -f namestate list | bystate
> > ksh: bystate: =A0not found
> > #
>
> That has nothing to do with awk so you should post the question to
> comp.unix.shell or similair. Having said that, below is a suggestion to
im=
prove
> your awk script...
>
>
>
>
>
> > Though bystate is a chmod 777 and contain that commands :
>
> > # cat bystate
> > #!/bin/sh
> > awk -F, '{
> > =A0 =A0 =A0 =A0 print $4 ", " $0
> > =A0 =A0 =A0 =A0 }' $* |
> > sort |
> > awk -F, '
> > $1 =3D=3D LastState {
> > =A0 =A0 =A0 =A0 print "\t" $2
> > }
> > $1 !=3D LastState {
> > =A0 =A0 =A0 =A0 LastState =3D $1
> > =A0 =A0 =A0 =A0 print $1
> > =A0 =A0 =A0 =A0 print "\t" $2
> > }'
>
> ... |
> awk -F, '
> $1 !=3D LastState { LastState =3D $1; print $1 }
> { print "\t" $2 }
> '
>
> =A0 =A0 =A0 =A0 Ed.- Hide quoted text -
>
> - Show quoted text -
Can I know How can I implement that command with Dos versions:
# sed -f namestate list | bystate
How can I convert that script to be run under awk95.exe
# cat bystate
#!/bin/sh
awk -F, '{
print $4 ", " $0
}' $* |
sort |
awk -F, '
$1 =3D=3D LastState {
print "\t" $2
}
$1 !=3D LastState {
LastState =3D $1
print $1
print "\t" $2


|