[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed command issue

From: Bob Proulx
Subject: Re: sed command issue
Date: Thu, 29 Nov 2018 17:04:48 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

Karthikeyan wrote:
> Hi Team,

Hi! :-)

> While executing the below sed command I am not getting output of timestamp
> log but its working on other linux server. Could you please help me on this
> issue?.
> sed -n '/20:42:01/,/20:50:59/p' log.txt

Not to complain too much but this is a help question and that would be
better sent to the < help-gnu-utils AT gnu.org > mailing list instead
of the catchall bug list here.  But you are here now so okay...

You have a sed command that looks okay to me.  And you say it is
working on one of the systems.  Therefore I think the command is okay
and the difference must the be log.txt file on the system where you
way it isn't working.

You didn't provide any sample data.  This makes it impossible for
anyone here to help.  All we can do is say, yes, looks okay to me.

  $ printf "20:42:01 foo\n20:45:00 boo\n20:50:59 bar\n" | sed -n 
  20:42:01 foo
  20:45:00 boo
  20:50:59 bar

Looks okay to me.  If it isn't working for you then look at the
log.txt contents and see why it is different on that system.

Also, if you really think there is a sed problem, then we need to know
a couple of more things.  We need to know the locale you are operating
in so that we know how the regular expressions will be used.  Might
suggest setting LC_ALL=C for the script.  But that doesn't look like
the problem in what you have said so far.


And we will need to know the version of sed.

  sed --version

However if it comes to that then this should really be taken over to
the < bug-devel AT gnu.org > mailing list for that discussion where it
can involve the sed maintainers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]