Here's an improved version, without sed gcal -i -s1 | tr -d [:space:] | tail -c2 the tr command can also be used to clean up the whitespace in the cal| colrm version cal | colrm 3 | tr -d [:space:] | tail -c2