Here is a simple one liner to get the week of month via awk from a `cal` output:
$ cal | awk -v date="`date +%d`" '{ for( i=1; i <= NF ; i++ ) if ($i==date) { print FNR-2} }'
tipsWeek of MonthSubmitted by sandip on Thu, 01/08/2009 - 10:24.Here is a simple one liner to get the week of month via awk from a `cal` output: $ cal | awk -v date="`date +%d`" '{ for( i=1; i <= NF ; i++ ) if ($i==date) { print FNR-2} }'highlight grep search stringSubmitted by sandip on Fri, 12/19/2008 - 15:09.Default to highlighting search string when using grep by adding the below alias to ~/.bashrc file: alias grep='grep --color=auto'analog filesize limitSubmitted by sandip on Tue, 09/16/2008 - 16:05.I had some trouble with analog monthly stats not showing up for the last week and figured out that analog refuses to parse huge log files. I had one sitting at 3GB without being rotated and analog would error out with: /usr/bin/analog: Warning F: Failed to open logfileAfter running gzip on the log file, analog was then able to produce the reports. I think I read somewhere that the limit may be 2GB but have not tested this. |
User loginRecent blog posts
Who's onlineThere are currently 0 users and 32 guests online.
|