Sponsored Content
Full Discussion: Change Date Input :-
Top Forums Shell Programming and Scripting Change Date Input :- Post 302970426 by vgersh99 on Wednesday 6th of April 2016 12:05:27 PM
Old 04-06-2016
Quote:
Originally Posted by asavaliya
Command not Found

Code:
./test.sh

must be in a diff path - probably /usr/bin/ksh93 - don't have Solaris in front of me.
Try it with /usr/bin/bash...

What Solaris version are you on? Do uname -a
This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Move A File With Same Date,don't Change The Desitination Dir Date

Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies

2. Shell Programming and Scripting

change standard input ?

Dear... I have a scrpit that contains multiple read command.... when I run the script I have to enter 3 variables so that I can get the output.. but, I dont want to put those 3 inputs manually every time... I want to make a shell that reads the 3 inputs from a file. the script name is... (4 Replies)
Discussion started by: yahyaaa
4 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. Debian

change the input method .

i open the google search and want to search something, now , i want to change the input method ,but i don't know how to change the default input. the default is english, how to exchange with others. thanks in advance (0 Replies)
Discussion started by: runeveryday
0 Replies

5. Shell Programming and Scripting

Change ip from user input

I have 2 Servers IP: 1)10.1.1.27 2)10.1.2.27 #more /etc/postfix/transport Domain.com smtp:ServerIP Now i want to change the smtp:ServerIP according to user interaction: (2 Replies)
Discussion started by: telnor
2 Replies

6. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (0 Replies)
Discussion started by: ust3
0 Replies

7. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 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

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

10. UNIX for Beginners Questions & Answers

How to change existing date to current date in a filename?

Suppose i have a list of files in a directory as mentioned below 1. Shankar_04152019_ny.txt 2. Gopi_shan_03122019_mi.txt 3. Siva_mourya_02242019_nd.txt .. . . . . 1000 . Jiva_surya_02282019_nd.txt query : At one shot i want to modify the above all filenames present in one path with... (4 Replies)
Discussion started by: Shankar455
4 Replies
date(1) 						      General Commands Manual							   date(1)

NAME
date - display or set the date and time SYNOPSIS
[mmddhhmm[[cc]yy]] sssfff]] DESCRIPTION
The command displays or sets the current HP-UX system clock date and time. Since the HP-UX system operates in Coordinated Universal Time (UTC), automatically converts to and from local standard or daylight/summer time, based on your environment variable. See in below. Options recognizes the following option: Input and output values in Coordinated Universal Time (UTC), functionally equivalent to Greenwich Mean Time (GMT), instead of in local time. Slowly adjust the time by seconds (fff represents fractions of a second). This adjustment can be positive or negative. The system's clock will be sped up or slowed down until it has drifted by the number of seconds specified. Formats The command has two forms for displaying the date and time and one form for setting them. Display the current date and time. The output is the same as for the formatting directive for all languages except the default language. See and below. Display the current date and time according to formatting directives specified in format, which is a string of zero or more formatting directives and ordinary characters. If it contains blanks, enclose it in apostrophes or quotation marks. See below. All ordinary characters are copied unchanged into the output string. The output string is always terminated with a newline character. If is specified and format is omitted, only a newline is output. Set the HP-UX system clock to the date and time specified. You require the superuser privilege. If you include the option, the specified date and time is assumed to be in Coordinated Universal Time (UTC). The numeric argument is interpreted left to right in two-digit pairs as follows: mm Month number dd Day number in the month hh Hour number (24-hour system) mm Minute number cc Century minus one yy Last two digits of the year number If omitted, the current year is used. If you attempt to set the date backwards, generates the warning, Type or the equivalent for your locale to set the clock backwards; anything else to cancel the command. When is used to set the date, a pair of date change records is written to the file (UNIX Standard only, see standards(5).) No warning is generated if date is set backwards. Formatting Directives The following formatting directives, shown without the optional field width and precision specification, are replaced by the indicated characters. If a directive is not one of the following, the result is undefined. The output for digits, characters, and words depends on the language/locale settings. See in below. The examples assume that the command was executed on Wednesday, January 12, 1994 at 7:45:58 p.m. Pacific Standard Time, using the default language. Abbreviated weekday name. For example, Full weekday name. For example, Abbreviated month name. For example, Full month name. For example, Current date and time representation. For example, Century (the year divided by 100 and truncated to an integer) as a two-digit decimal number For example, Day of the month as a two-digit decimal number For example, Day of the month as a two-character decimal number with leading space fill [ ]. For example, Combined Emperor/Era name and year. Hour (24-hour clock) as a two-digit decimal number For example, Hour (12-hour clock) as a two-digit decimal number For example, Day of the year as a three-digit decimal number For example, Month as a decimal two-digit number For example, Minute as a decimal two-digit number For example, Newline character. Emperor/Era name. Emperor/Era year. Equivalent of either AM or PM. For example, Time as %H:%M Second as a two-digit decimal number (allows for possible leap seconds) For example, Tab character. Weekday as a one-digit decimal number For example, Week number of the year (Sunday as the first day of the week) as a two-digit decimal number All days that precede the first Sunday in the year are considered to be in week For example, Week number of the year (Monday as the first day of the week) as a two-digit decimal number If the week containing January 1 has four or more days in the new year (January 1 is Thursday or sooner), it is designated as week otherwise, (January 1 is Friday or later), it is designated as the last week of the previous year, and the next week is week For example, Weekday as a one-digit decimal number For example, Week number of the year (Monday as the first day of the week) as a two-digit decimal number All days that precede the first Monday in the year are considered to be in week For example, Current date representation. For example, Current time representation. For example, Year without century as a two-digit decimal number For example, Year with century as a four-digit decimal number For example, Time zone name (or no characters if time zone cannot be determined). For example, The character. Obsolescent Directives The following directives are provided for backward compatibility. It is recommended that the preceding directives be used instead. Date in usual U.S. format. For example, Use or instead. Full month name. For example, Use instead. Abbreviated month name. For example, Use instead. Time in 12-hour U.S. format. For example, Use instead. Time in 24-hour U.S. format. For example, Use or instead. Time zone name (or no characters if time zone cannot be determined). For example, Use instead. Modified Formatting Directives Some Formatting Directives can be modified by the and modifier characters to indicate a different format or specification for the language specified in the environment variable. If the corresponding keyword and is not specified or not supported, the unmodified field descriptor value is used. The command displays the keywords and their values in the specified language (see locale(1)). Alternate appropriate date and time representation. The name of the base year in alternate representation. Alternate date representation. Offset from (year only) in the alternate representation. Full alternate year representation. Day of month using the alternate numeric symbols. Day of month using the alternate numeric symbols with leading space-character fill if applicable. Hour (24-hour clock) using the alternate numeric symbols. Hour (12-hour clock) using the alternate numeric symbols. Month using the alternate numeric symbols. Minutes using the alternate numeric symbols. Seconds using the alternate numeric symbols. Week number of the year (Sunday is the first day of the week) using the alternate numeric symbols. Weekday as number using the alternate numeric symbols Weekday number of the year (Monday is the first day of the week) using the alternate numeric symbols. Year (offset from in alternate representation. Field Width and Precision An optional field width and precision specification can immediately follow the initial of a formatting directive in the following order: The decimal digit string width specifies a minimum field width in which the result of the conversion is right- or left-justified. The default is right-justified with space padding on the left. If the string starts with "", the result is left-justified with space padding on the right. If the string starts with "", the result is right-justified and padded with zeros on the left. The decimal digit string prec specifies the minimum number of digits to appear for the and numeric directives. If a directive supplies fewer digits than specified by the precision, it will be expanded with leading zeros. prec specifies the maximum number of characters to be used from the and text directives. If a directive supplies more characters than specified by the precision, excess characters are truncated on the right. If no field width or precision is specified for a or directive, the default is for the directive, the default is for the default is for the default is EXTERNAL INFLUENCES
For information about the UNIX Standard environment, see standards(5). Environment Variables determines the interpretation of the bytes within the format string as single- and/or multi-byte characters. determines the characters used to form numbers for those directives that produce numbers in the output. The characters used are those defined by (see locale(1) and in langinfo(5)). determines the content (for example, the weekday names produced by the directive) and format (for example, the current time representation produced by the directive) of date and time strings output by the command. determines the language in which messages (other than the date and time strings) are displayed. If or is not specified or is null, it defaults to the value of If is not specified or is null, it defaults to (see lang(5)). If any internationalization variable contains an invalid setting, all internationalization variables default to (see environ(5)). determines the conversion between the system time in UTC and the time in the user's local time zone. See environ(5) and tztab(4). also determines the content (that is, the time-zone name produced by the and directives) of date and time strings output by the command. If is not set or is set to the empty string, its default value is If the or the value cannot be read from the time zone adjustment table then returns the time in International Code Set Support Single and multibyte character code sets are supported. DIAGNOSTICS
The following messages may be displayed. The date/time specification is syntactically incorrect. Check it against the usage and for the correct range of each of the digit-pairs. The character c is not a valid format directive, field width specifier, or precision specifier. The date/time you specified is earlier than the current clock value. Type (or the equivalent for your locale) to set the clock backwards; anything else to cancel the command. You need the superuser privilege to change the date. EXAMPLES
Date in Different Languages Display the date. In this example, the environment variable contains and the language environment variables are set as noted. Set Date Set the date to Oct 8, 12:45 a.m. Display Formatted Date Display the current date and time using a format. Note the use of quotation marks due to the blanks in the format. The output resembles the following: Display Formatted Date Using Local Language Conversion With the date as set in the "Set Date" example above and set to (German): generates output similar to: where the month field is four characters long, flush-left, and space-padded on the right if the month name is shorter than four characters. The day field is two characters long, with leading zeros suppressed. WARNINGS
The former HP-UX format directive has been changed to for ANSI compatibility. Changing the date while the system is running in multiuser mode should be avoided to prevent disrupting user-scheduled and time sensitive programs and processes. Also, changing the date can cause and the SCCS and subsystems to behave in an unexpected manner. The daemon should be killed prior to setting the date backwards, then restarted. SCCS files should be checked with the command (see val(1)) if deltas have been made while the clock was wrongly set. The following formatting directives may be deleted from future releases: Currently, the maximum date supported is December 31, 2037 23:59:00 UTC. AUTHOR
was developed by AT&T and HP. FILES
SEE ALSO
locale(1), stime(2), ctime(3C), strftime(3C), tztab(4), environ(5), lang(5), langinfo(5), standards(5). STANDARDS CONFORMANCE
date(1)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy