This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Fun with operators, conditionals and exported functions. Notes below. | |
y=$(date +%Y) | |
d=$(date +%d) | |
m=$(date +%m) | |
u=`whoami` | |
s=`pwd` | |
if [ $d -lt 25 ] && [ $m == 12 ] && [[ "$s" == *"home/phoebe/shell"* ]] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Process most common words from web page, and output to file, using wget, sed, awk, sort command line utilities. | |
Using both sed #and awk methods provides greatest accuracy. Example is for YouTube video comments. | |
#sed stream editor method: | |
wget -O - https://gdata.youtube.com/feeds/api/videos/ffVbnPjl86A/comments?orderby=published \ | |
| sed -e 's/<[^>]*>//g' | tr -cs A-Za-z\' '\n' \ #clean up HTML tags; convert all to lowercase | |
| tr A-Z a-z | sort | uniq -c | sort -k1,1nr -k2 | sed ${1:-200}q > conan.txt | |
NewerOlder