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


Thread Tools Search this Thread Display Modes
Old Unix and Linux 12-06-2013   -   Original Discussion by MattyJ2009
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Join Date: May 2012
Last Activity: 17 March 2018, 10:35 AM EDT
Location: Simplicity
Posts: 4,008
Thanks: 343
Thanked 1,346 Times in 1,214 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   -   Original Discussion by MattyJ2009
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
Join Date: Jun 2007
Last Activity: 16 March 2018, 1:26 PM EDT
Location: Lancashire, UK
Posts: 3,495
Thanks: 1,527
Thanked 683 Times in 615 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

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 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 12:41 PM.