LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-25-2001, 04:06 PM   #1
msj
LQ Newbie
 
Registered: Aug 2001
Location: Canada
Posts: 3

Rep: Reputation: 0
Post Small Script


I've been trying to creat a small script so it would we able to say Hi from 8:00 to 5:00pm and Good bye form 5:00pm to 11:00pm but nothing seems to work.

Please help me

Thanks
 
Old 08-26-2001, 08:27 PM   #2
tarballedtux
Member
 
Registered: Aug 2001
Location: Off the coast of Madadascar
Posts: 498

Rep: Reputation: 30
Friendly Scripting

Note: You are using RedHat Linux w/ Bash installed

#!/bin/bash
time=`/sbin/hwclock | cut -d: -f1 | cut -d' ' -f4`
if [ $time \> 8 ]; then
if [ $time \< 5 ]; then
echo "Hello, $USER"
fi
else
echo "Good Bye, $USER"
fi


If it is meant to be put in the login file then out in the apporpriate one.
 
Old 08-27-2001, 06:59 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
http://www.linuxquestions.org/questi...t=small+script
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
small script Kassel Programming 2 11-19-2004 04:22 AM
help with a very small script hamish Linux - General 3 06-09-2004 02:10 AM
Need help with very small script. Franklin Programming 8 10-14-2003 12:37 PM
Please Help with a small script ? juglugs Programming 2 11-14-2001 02:39 AM
small script msj Programming 1 08-26-2001 11:42 AM


All times are GMT -5. The time now is 04:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration