|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Input date on script
How can I allow users to change the date and time in a script? Say the user1 wil login and he will be inputting the desired date (example format below). I will need this script so the user can login and change the date anytime during the day. I will not allow him to use any command except the date change so Im planning to incorporate a menu script on it. Pls help. Thanks
echo" pls input date" date 12052012 -------user will type like this one for date date -s 08:00:00------ user will type like this one for time thanks, lhareigh |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
An example using case in bash: Code:
#! /bin/bash
echo "Enter option: "
read option
case $option in
1) echo "One" ;;
2) echo "Two" ;;
*) echo "Everything else"
esac |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
If a user input date 12072012, the system date will change to 12/07/2012. If a user will input date -s 23:00:00 the time will be change to 23:00:00.
Do you have any script on how can this be possible? |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to delete files with an input for directories and an input for path/file | *ShadowCat* | Shell Programming and Scripting | 3 | 06-28-2012 09:16 PM |
| The scope of the shell/perl script is to read the input text file. Validate the expiry date of each | casmo | Shell Programming and Scripting | 5 | 04-21-2011 11:06 AM |
| Echo date variable from data input to a script | iga3725 | Shell Programming and Scripting | 6 | 12-07-2010 12:00 PM |
| Get date range between 2 date input | tanit | Shell Programming and Scripting | 3 | 04-21-2009 11:20 AM |
| Script to find files on a given input date | ar.karan | Shell Programming and Scripting | 1 | 08-13-2007 10:07 PM |
|
|