Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > gnu.utils.bug > #2259
| From | Bob Proulx <bob@proulx.com> |
|---|---|
| Newsgroups | gnu.utils.bug |
| Subject | Re: sed command issue |
| Date | 2018-11-29 17:04 -0700 |
| Message-ID | <mailman.4892.1543536876.1284.bug-gnu-utils@gnu.org> (permalink) |
| References | <CAMQ5_3GUcqaBoYm8UKPY0gE_BE0mJ3KPJ3ZbS4RtgV1WQevBLw@mail.gmail.com> |
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/,/20:50:59/p' 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. locale 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. Bob
Back to gnu.utils.bug | Previous | Next | Find similar
Re: sed command issue Bob Proulx <bob@proulx.com> - 2018-11-29 17:04 -0700
csiph-web