Charles Steinkuehler wrote:
> 
> > > You can generally replace 'wc -l' with sed -n '$=', although you won't
> get a
> > > zero output if there are no lines.
> >
> > I know about this construct, using two (2) sed's:
> >
> > sed -n = | sed -n '$p'
> >
> > On Dachstein-CD:
> >
> > sed -n '$='
> >
> > returns:
> >
> > sed: -e expression #1, char 1: Unknown command: ``?''
> >
> > What do you think?
> 
> Hmm...works for me:
> 
> krypton.private.network: -root-
> # sed -n '$=' /etc/network.conf
> 767
> 
> krypton.private.network: -root-
> #
> 
> The sed man page from debian lists = as a "Zero- or One- address command",
> and $ is a valid single address...

Yes, from the CLI, as you illustrate, it *does* work.  I didn't try that
;<

However, these *all* fail:

sed -n '/ DENY /s/DENY//p' /var/log/kern.log | sed -n '?='
sed: -e expression #1, char 1: Unknown command: ``?''

sed -n '/ DENY /s/DENY//p;?=' /var/log/kern.log
sed: -e expression #1, char 19: Unknown command: ``?''

sed -n '/ DENY /s/DENY//;?=' /var/log/kern.log
sed: -e expression #1, char 18: Unknown command: ``?''

I want to use sed to filter on [address]:

        / DENT /

perhaps (or not) execute some command:

        s/DENY//

and -- in that same instance of sed -- *count* the lines of output.

What do you think?

-- 

Best Regards,

mds
mds resource
888.250.3987

Dare to fix things before they break . . .

Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . .

_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to