Unix/Linux Go Back    

Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Display Message Question


Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 12-06-2013
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
Join Date: May 2012
Last Activity: 8 October 2015, 2:28 PM EDT
Location: Simplicity
Posts: 2,654
Thanks: 201
Thanked 813 Times in 732 Posts
This works in any shell but C-shell and with most time zones:

today=`date "+%b %e"`
yesterday=`TZ=$TZ+24 date "+%b %e"`
dmesg | egrep "^($today|$yesterday) "

Sponsored Links
Old Unix and Linux 12-10-2013
rbatte1 rbatte1 is offline Forum Staff  
Join Date: Jun 2007
Last Activity: 23 September 2015, 12:14 PM EDT
Location: Lancashire, UK
Posts: 2,433
Thanks: 842
Thanked 433 Times in 388 Posts
What shell are you running in? If you are not sure, you can confirm this with the output of the command ps -f

You error suggests you are not in bash or ksh, so we need to be sure first.

Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Refrain the Message of File Not exists display out ckwan Shell Programming and Scripting 3 11-27-2013 04:14 AM
Display a message if the server is prompting urfrnddpk Shell Programming and Scripting 0 06-14-2011 02:49 AM
Script that will display a short message jmack123 UNIX Desktop for Dummies Questions & Answers 2 04-16-2010 06:58 PM
How do display a warning message? kris2010 Shell Programming and Scripting 4 03-25-2010 10:56 AM
How to display message when starting a terminal mrudula009 Shell Programming and Scripting 27 06-17-2009 06:41 AM

All times are GMT -4. The time now is 05:29 PM.