Sponsored Content
Full Discussion: Input date on script
Top Forums Shell Programming and Scripting Input date on script Post 302740213 by lhareigh890 on Wednesday 5th of December 2012 07:52:21 PM
Old 12-05-2012
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

date input

hi, im a beginner 4 unix. in a shell script im reading a date variable.the system should guide the user.i mean validation techniques in shell programming.how can i do that. thanks. (2 Replies)
Discussion started by: uniqmaniak
2 Replies

2. Shell Programming and Scripting

Script to find files on a given input date

Hello gurus, I need to write a script to find out all the file that got changed on a specific folder since a given input date (Date to be given as Input) Thanx (1 Reply)
Discussion started by: ar.karan
1 Replies

3. Shell Programming and Scripting

Get date range between 2 date input

Hi Experts, I have files name report_20090416 report_20090417 report_20090418 report_20090420 report_20090421 I have 2 input from user From Date: 20090417 To Date: 20090420 and I need to grep only those line in between. Output should be report_20090417 report_20090418... (3 Replies)
Discussion started by: tanit
3 Replies

4. Shell Programming and Scripting

Echo date variable from data input to a script

Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7. #!/bin/bash dia () { echo " Seleccione el dia:" select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir do... (6 Replies)
Discussion started by: iga3725
6 Replies

5. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies

6. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

7. UNIX for Advanced & Expert Users

Help with ksh script to list, then cp files from a user input date range

Hi, I'm quite new to ksh scripting, can someone help me with this. Requirements: I need to create a script that list the files from a user input date range. e. g. format of file: *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00*... (1 Reply)
Discussion started by: chococrunch6
1 Replies

8. Shell Programming and Scripting

Get yesterdays Date for Input Date

Hi, I have been trying to get the yesterdays date for the Input date I pass. I know how to do for the current timestamp but how to do for the input date. Is there any way I can convert to epoch time and do manipulations and back to human readable date? Please help Thanks ... (1 Reply)
Discussion started by: abhi1988sri
1 Replies

9. Shell Programming and Scripting

Input Date to mm/dd/yy

Hi, I am new to unix and I am doing following steps : 1. Ask user to enter date in mm-dd-yyyy format. 2. show the date user entered from step #1 . 3. convert user enter date into YYYY/MM/DD format. Here is the script I am using echo "Please enter the date in mm-dd-yyyy format:... (1 Reply)
Discussion started by: ZeroHedge
1 Replies

10. Shell Programming and Scripting

Script to get previous date for the given input date..

hi all, need a script or command to get the previous date for the given input date... like in my script i will pass date as input parameter like 2014-12-01 and i want the output as previous date.. ie.. 2014-11-30 (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
UTMP(5) 						      BSD File Formats Manual							   UTMP(5)

NAME
utmp, wtmp, lastlog -- login records (DEPRECATED) SYNOPSIS
#include <utmp.h> DESCRIPTION
The interfaces in file <utmp.h> are all DEPRECATED and are only provided for compatibility with previous releases of Mac OS X. See pututxline(3) and utmpx(5) for the supported interfaces. <utmp.h> declares the structures used to record information about current users in the file utmp, logins and logouts in the file wtmp, and last logins in the file lastlog. The time stamps of date changes, shutdowns and reboots are also logged in the wtmp file. These files can grow rapidly on busy systems, daily or weekly rotation is recommended. If any of these files do not exist, it is not cre- ated. These files must be created manually and are normally maintained in either the script /etc/daily or the script /etc/weekly. (See cron(8).) #define _PATH_UTMP "/var/run/utmp" #define _PATH_WTMP "/var/log/wtmp" #define _PATH_LASTLOG "/var/log/lastlog" #define UT_NAMESIZE 8 #define UT_LINESIZE 8 #define UT_HOSTSIZE 16 struct lastlog { time_t ll_time; char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; struct utmp { char ut_line[UT_LINESIZE]; char ut_name[UT_NAMESIZE]; char ut_host[UT_HOSTSIZE]; time_t ut_time; }; Each time a user logs in, the login program looks up the user's UID in the file lastlog. If it is found, the timestamp of the last time the user logged in, the terminal line and the hostname are written to the standard output. (Providing the login is not quiet, see login(1).) The login program then records the new login time in the file lastlog. After the new lastlog record is written , the file utmp is opened and the utmp record for the user inserted. This record remains there until the user logs out at which time it is deleted. The utmp file is used by the programs rwho(1), users(1), w(1), and who(1). Next, the login program opens the file wtmp, and appends the user's utmp record. The same utmp record, with an updated time stamp is later appended to the file when the user logs out. (See launchd(8).) The wtmp file is used by the programs last(1) and ac(8). In the event of a date change, a shutdown or reboot, the following items are logged in the wtmp file. reboot shutdown A system reboot or shutdown has been initiated. The character '~' is placed in the field ut_line, and reboot or shutdown in the field ut_name. (See shutdown(8) and reboot(8).) date The system time has been manually or automatically updated. (See date(1).) The command name date is recorded in the field ut_name. In the field ut_line, the character '|' indicates the time prior to the change, and the character '{' indicates the new time. FILES
(These files no longer exist in 10.5 or later.) /var/run/utmp The utmp file. /var/log/wtmp The wtmp file. /var/log/lastlog The lastlog file. SEE ALSO
last(1), login(1), who(1), ac(8), launchd(8) HISTORY
A utmp and wtmp file format appeared in Version 6 AT&T UNIX. The lastlog file format appeared in 3.0BSD. 4th Berkeley Distribution March 17, 1994 4th Berkeley Distribution
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy