Fedora Linux Support Community & Resources Center
Old 28th October 2004, 05:48 PM
cyanid3 Offline
Registered User
Join Date: Sep 2004
Posts: 43

I want to make a startup script that will choose between different wireless networks based on what time it is. I'm not the most familiar with writing shell scripts, i usually just end up figuring out how to do specific things as I go.

What I want to do: (the syntax is probably wrong, I can figure it out)

if "time variable" = before some time
use this Wireless network
use the other wireless network

I just need to find out what I would use as the "time variable"

There probably is some program that works in a similar way. If anyone knows of one, that would be great too

Reply With Quote
Old 28th October 2004, 06:30 PM
tchung Offline
FedoraNEWS.org Admin
Join Date: Feb 2004
Location: California, US
Posts: 561
I would suggest to use "date" command.

For example, "date +%X" gives you current time.

[tchung@tchung-linux tchung]$ date +%X
10:24:38 AM

See man date for detail.

Thomas Chung
Reply With Quote
Old 28th October 2004, 06:41 PM
GreyGeek Offline
Registered User
Join Date: Aug 2004
Location: Lincoln, NE
Age: 76
Posts: 83
Go to
and you'll find an excellent how-to on advanced bash scripting.
That site also links to a downloadable PDF file too.
Consider using the %s option, which is seconds since midnite 01/01/1790 to set the "time variable" to some future time. Then you can test against $(date +%s) to see if 'now' is greater than "time variable"
Reply With Quote
Old 28th October 2004, 10:33 PM
cyanid3 Offline
Registered User
Join Date: Sep 2004
Posts: 43
See, that's why I love this forum. You ask a question that probably doesn't make sense, and you get way more information than you were counting on. Thanks guys, this helps a lot.
Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The system date and time is changing automatically, even after I set the correct time siva Using Fedora 8 31st July 2010 03:07 PM
Fedora 8 dual boot with Windows XP [Pavilion dv6137tx] Time gets reset every time! maverick280857 Hardware & Laptops 5 23rd March 2008 11:48 AM
vsftpd timestamp using current time instead of file time wshawn Servers & Networking 0 2nd November 2006 11:37 PM
FC5 light blue stripes all over the desktop from time to time paidopoieo Using Fedora 4 10th May 2006 04:36 PM
Change time on lots of files, and time errors. Jeremy Ross Using Fedora 6 24th February 2005 04:43 AM

Current GMT-time: 17:36 (Wednesday, 16-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat