String of text conversion
I'm writing a centralized logging piece, and I need to grep out logs that have specific date tags. The date command returns abbreviated months (Sep), via "#date -d yesterday '+%b'" but I need it all caps. ie SEP vice Sep. Otherwise the grep doesn't catch it. Any ideas?
edit...going to use "grep -i" in the meantime until a better solution comes along |
The -i option (on grep) tells grep to ignore case.
Edit: You beat me to it. :) |
How complex and necessary is it to parse out the abbreviated month only from the log entries? Would it matter if you translated say "Decision" in the log text to "DECision"? sed is probably the best tool for the job ...
|
When generating the date (mth) string, pass it through tr
$ echo 'linux' | tr "[:lower:]" "[:upper:]" http://www.cyberciti.biz/faq/how-to-...ix-tr-command/ |
All times are GMT -5. The time now is 12:11 AM. |