Kernighans large earthquake problem: Difference between revisions

Add Bash
(Add Cowgol)
(Add Bash)
Line 390:
=={{header|AWK}}==
<lang awk> awk '$3 > 6' data.txt</lang>
 
=={{header|Bash}}==
<lang bash>#!/bin/bash
while read line
do
[[ ${line##* } =~ ^([7-9]|6\.0*[1-9]).*$ ]] && echo "$line"
done < data.txt</lang>
 
{{out}}
 
<pre>$ cat data.txt
8/27/1883 Krakatoa 8.8
5/18/1980 MountStHelens 7.6
3/13/2009 CostaRica 5.1
1/23/4567 EdgeCase1 6
1/24/4567 EdgeCase2 6.0
1/25/4567 EdgeCase3 6.1
$ bash quake.sh
8/27/1883 Krakatoa 8.8
5/18/1980 MountStHelens 7.6
1/25/4567 EdgeCase3 6.1</pre>
 
=={{header|C}}==
2,093

edits