Hi, have been working through some examples to get the hang of sed when I came upon this one which doesnt seem to work.
" sed -n '/ 0\.[0-9] [0-9]$/p' fruit_prices.txt "
running this command is supposed to output
Banana 0.89
Paech 0.79
Apple 0.99
However all I get is the prompt.
here is the link to the site:
http://kristi.erdves.lt/books/Comput...6/251-254.html
[root@jekyll test]# ls -l
total 8
-rw-r--r-- 1 root root 101 Sep 16 09:48 fruit_prices.txt
-rw-r--r-- 1 root root 36 Sep 14 18:12 regexp.txt
[root@jekyll test]# cat fruit_prices.txt
Fruit Price/lbs
Banana 0.89
Paech 0.79
Kiwi 1.50
Pineapple 1.29
Apple 0.99
Mango 2.20
[root@jekyll test]# sed '/ 0\.[0-9] [0-9]$/p' fruit_prices.txt
Fruit Price/lbs
Banana 0.89
Paech 0.79
Kiwi 1.50
Pineapple 1.29
Apple 0.99
Mango 2.20
[root@jekyll test]# sed -n '/ 0\.[0-9] [0-9]$/p' fruit_prices.txt
[root@jekyll test]#