Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Change time with current year Post 302666193 by jayan_jay on Wednesday 4th of July 2012 01:31:18 AM
Old 07-04-2012
Code:
$ sed "s,..:..-,$(date +%Y)-,g" infile
hostname 2007-Feb-9 /u100/DEVCO/Patching a.log
hostname 2010-Jun-25 /u100/DEVCO/DumpCleaner a.log
hostname 2011-Jun-25 /u100/DEVCO/DumpCleaner/sample a.log
hostname 2012-Jun-25 /u100/DEVCO/DumpCleaner/sample b.log
hostname 2012-Jun-25 /u100/DEVCO/DumpCleaner/Recycle a.log
hostname 2012-Jun-25 /u100/DEVCO/DumpCleaner/Recycle b.log
$

This User Gave Thanks to jayan_jay For This Post:
 

10 More Discussions You Might Find Interesting

1. IP Networking

change my current IP address

Dear All , I have Sun Solaris 8 machine . during installation i gave the machine ip address 192.168.0.50 and gatway 192.168.0.1 . now i hvae to change the IP address and the gateway ! how ?? i know i have to use ifconfig , but how can i change it and the gateway ??? also where from i... (4 Replies)
Discussion started by: tamemi
4 Replies

2. Solaris

change year in the server

HOw do I change the year in Solaris server. I changed the timezone to IST which caused the year to change to 2015. How do I change the year?? (1 Reply)
Discussion started by: krishan
1 Replies

3. Shell Programming and Scripting

read file and print additional rows till current year

Hi all i have a file like 2006,1,2 2007,2,3 2008,3,4 I will read this and my output should be like 2006,1,2 2007,1,2 2008,1,2 2007,2,3 2008,2,3 2008,3,4 Giving the explanation, we will read the first line of the file and if the year any other than current year, we will print as many... (1 Reply)
Discussion started by: vasuarjula
1 Replies

4. UNIX for Dummies Questions & Answers

comparing field to current year

Hi, I have a comma delimited file that contains name, account number, and account date/time(example record below). I want to pull off all the records that have an account date greater than 8/1 of the current year, and create a new file with those records. So for this year, it would take... (6 Replies)
Discussion started by: keeferb
6 Replies

5. Post Here to Contact Site Administrators and Moderators

change the year in the event prediction market

Can you change the year in the event prediction market Facebook Stock Will Be Over $70 a Share By the End of 2102? (Closes for placing Bits on 09-30-12 - 10:30 PM) (8 Replies)
Discussion started by: itkamaraj
8 Replies

6. Shell Programming and Scripting

How to pass current year and month in FOR LOOP in UNIX shell scripting?

Hi Team, I have created a script and using FOR LOOP like this and it is working fine. for Month in 201212 201301 201302 201303 do echo "Starting the statistics gathering of $Month partitions " done But in my scripts the " Month " variable is hard-coded. Can you please any one... (3 Replies)
Discussion started by: shoan
3 Replies

7. Slackware

/boot: how do I change the current kernel?

Slackware 14.0 Hi: I once changed the smp kernel running in my system by another one in /boot. What I did was to relink /boot/System.map, /boot/vmlinuz and /boot/config. But I don't remember if I did something else. Would that alone be OK. (4 Replies)
Discussion started by: stf92
4 Replies

8. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

9. Shell Programming and Scripting

To get the time exactly 24hrs from the current time

Hi guys, I am having file which contains below data. 2012-04-24 08:40:13 10739022730 1027699274PersonInfoShipTO details missing FirstName,LastName, 2012-04-24 08:40:13 10739022730 1027699274PersonInfoShipTO details missing FirstName,LastName, 2012-04-24 08:40:13 ... (2 Replies)
Discussion started by: mohanalakshmi
2 Replies

10. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies
rhosts(5)							File Formats Manual							 rhosts(5)

Name
       rhosts - list of hosts that are logically equivalent to the local host

Syntax
       /$HOME/.rhosts

Description
       The  file  allows  a  user  who has an account on the local host to log in from a remote host without supplying a password.  It also allows
       remote copies to the local host.

       If the file exists, it is located in a user's home directory.  It is not a mandatory file, however.

       The format of a file entry is:
       hostname [username]
       The hostname is the name of the remote host from which the user wants to log into the local host.  The username is the user's login name on
       the remote host.  If you do not specify a user name, the user must have the same login name on both the remote and local hosts.

       The  host  names  listed in the file may optionally contain the local BIND domain name.	For more information on BIND, see the Guide to the
       BIND/Hesiod Service.

       If a user is logged in to and wants to log in to a host called without supplying a password, she must:

       o    Have an account on

       o    Create a file in her home directory on

       o    Specify host1 ginger as an entry in the file.
	    If has the same login on both and she can simply specify host1 in her entry.  You can allow the superuser of a remote system to log in
	    to your system without password protection or perform a remote copy by having a file in the root ( / ) directory, but it is not recom-
	    mended.
	    In addition to having a file, the superuser needs a terminal entry in the file for each pseudoterminal configured in the system.   The
	    secure entry looks similar to the following:
	    ttyp3      none    network	       secure
	    See the reference page for more information.

Examples
       The  following is a sample file for the user It is located in her home directory on She also has accounts on the hosts called and Her login
       name on and is the same as on but her login on is

       To enable to log in to from and without supplying a password, her on should contain the following entries:
       machine1
       system1	gordon
       host3

See Also
       hosts.equiv(5), ttys(5)
       Introduction to Networking and Distributed System Services

																	 rhosts(5)
All times are GMT -4. The time now is 01:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy