File this under #shell #functions I should have written years ago:
function grepc {
#Do a grep -c, but skipping files with no results
grep -c "$@" |grep -v ':0$'
}
File this under #shell #functions I should have written years ago:
function grepc {
#Do a grep -c, but skipping files with no results
grep -c "$@" |grep -v ':0$'
}
Today's #APOD's a looker ;)
Date: 2026 February 02
URL: https://apod.nasa.gov/apod/ap260202.html
Title: Orion: The Running Man Nebula
P.S., the body of the parent #toot was created by a simple #shell #function:
function apod {
#Today's NASA Astronomy Picture of the Day info-fetcher
curl -sL 'https://apod.nasa.gov/apod/archivepix.html' \
|grep -m1 "[0-9][0-9]:" \
|sed 's/^/Date: /;
s|: *<a href="|\nURL: https://apod.nasa.gov/apod/|;
s/">/\nTitle: /; s/<.*$//'
echo
echo "#NASA #Astronomy #PictureOfTheDay"
}
#bash #ksh #mksh #shellScripting #unix #UnixShell #WebScraping #Scraping #HTML
Since people are going nuts online about how perfect February 2026 is... here you go:
~ $ cal feb 2026
February 2026
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
~ $ for x in {1900..2050}; do cal feb $x |grep -q "^ 1 " && echo $x; done
1903
1914
1920
1925
1931
1942
1948
1953
1959
1970
1976
1981
1987
1998
2004
2009
2015
2026
2032
2037
2043