- Rosetta Code (solutions of different languages to the same tasks)
- TIBOE Index (about market shares of programming languages)
- Comparison of programming languages (about syntax)
- Programming language popularity chart (based on GitHub & Stack Overflow)
- Most popular coding languages of 2014
2014-02-21
Programming Languages
About the versatile programming languages:
2014-01-07
How many lines in a file?
It's an easy (but not clear, please refer to the Note of wc below) question, but sill quite funny.
Tested under the Bash shell on Ubuntu 12.04 32-bit.
(1) wc
cat sample.txt | wc -l
or
wc sample.txt | awk '{print $1}'
awk is used to extract the 1st field.
Note: wc only counts the newline characters! The last line without newline is not counted. For example:
echo -ne "ab\ncd" | wc -l
would generate 1 (line), not 2.
Tested under the Bash shell on Ubuntu 12.04 32-bit.
(1) wc
cat sample.txt | wc -l
or
wc sample.txt | awk '{print $1}'
awk is used to extract the 1st field.
Note: wc only counts the newline characters! The last line without newline is not counted. For example:
echo -ne "ab\ncd" | wc -l
would generate 1 (line), not 2.
訂閱:
文章 (Atom)