English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

School work. I am trying to-List all cars with price tags of less than 10000? grep [1-9]000$ cars. This is all the prices. I want less than 10000. Can someone help me??

2007-10-14 06:10:37 · 5 answers · asked by nat 2 in Computers & Internet Programming & Design

None of below answer worked. Thanks for your help guys.

2007-10-16 05:47:20 · update #1

5 answers

Not an expert
but your expression means car price between $1000 to $9000
sorry but cannot give you solution for your question. just started learning unix

2007-10-14 06:18:51 · answer #1 · answered by Mōlě 6 · 0 0

grep is a text searching tool. If you have a version that will search a range, it is not standard. If [1-9] in your version uses 1,2,3,4,5,6,7,8,9 that is still only going to find 1000, 2000, 3000, etc., and not 1234 or 4356. I think what you want to use is pattern matching looking for 4 digit numbers preceeded by a $. You may also have to look for $ a digit, a comma, and then any three digits.

2007-10-14 06:21:01 · answer #2 · answered by Mike1942f 7 · 0 0

Sounds form of complicated for a a million-line shell command, particularly making use of purely grep. in my opinion i might write a rapid perl script to do it. i might write it for you presently, yet i'm lazy suitable now, perhaps later.

2016-11-08 07:14:14 · answer #3 · answered by tamala 4 · 0 0

If your fields delimiter is a white-space:
grep ' [0-9].?.?.?.?$'
Note that there is a space between the quote and the bracket to denote the white-space delimiter.

the dot-questionmark (.?) symbol is wildcard for regular expressions to denote a single character.

2007-10-14 06:39:35 · answer #4 · answered by mp_castro 2 · 0 0

Please try this

grep -x [1-9999]$ filename

I hope this helps.

thnx.

2007-10-14 23:10:41 · answer #5 · answered by shaan 2 · 0 0

fedest.com, questions and answers