Sponsored Content
Top Forums Shell Programming and Scripting Can someone help me to convert the date format after get it from the "LAST REBOOT" command. Post 302444925 by pichitw on Friday 13th of August 2010 07:24:54 AM
Old 08-13-2010
Hammer & Screwdriver Can someone help me to convert the date format after get it from the "LAST REBOOT" command.

Can someone help me to convert the date format after get it from the "LAST REBOOT" command.

these is the standard output.
bash-3.00# last reboot
reboot system boot Fri Aug 6 15:07
reboot system down Fri Aug 6 15:04
reboot system boot Wed Jul 14 16:12
reboot system down Tue Jul 6 20:04
reboot system boot Tue Jul 6 19:59
reboot system down Fri May 7 10:22
reboot system boot Fri May 7 10:01
wtmp begins Fri May 7 10:01
bash-3.00#

But.. I want
reboot system boot 2010-08-06 15:07
reboot system down 2010-08-06 15:04
reboot system boot 2010-08-06 16:12
reboot system down 2010-08-06 20:04
reboot system boot 2010-08-05 19:59
reboot system down 2010-08-05 10:22
reboot system boot 2010-08-06 10:01

Is it posible?
 

10 More Discussions You Might Find Interesting

1. AIX

Issues with "SU - userid -c command" on system reboot

Hi All! My db2 is started in the AIX /etc/inittab on systemreboot as follows db3:2:once:su - db2inst3 -c db2start >/dev/console 2>1 I changed the .profile of db2inst3 to put an alias to the db2start command as follows alias db2start="/usr/bin/ksh /home/db2inst3/sample/db2start.ksh" When... (1 Reply)
Discussion started by: voorkey
1 Replies

2. Shell Programming and Scripting

Date increment in the format "YYYYMMDD"

Hi all, I want to increment the date which is in the format "YYYYMMDD". ex: If the date is 20010601 Increment should be: 20010602, 20010603 etc., Any help will be much appreciated. Many Thanks and Regards, Ganapati (4 Replies)
Discussion started by: ganapati
4 Replies

3. UNIX for Dummies Questions & Answers

converting date format: "May 31 2008" to "2008-05-31"

I have the following script to find out the last day of the last month .... and the output of this script is in the following format ... Script goes like this .... #!/bin/ksh cur_month=`date +%m` cur_year=`date +%Y` prev_month=$(($cur_month-1)) # Check to see if this is January if ... (8 Replies)
Discussion started by: santosham
8 Replies

4. Shell Programming and Scripting

Format output from the file to extract "date" section

Hello Team , I have to extract date section from the below file output. The output of the file is as shown below. I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Discussion started by: coolguyamy
4 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

How to increment date using "for loop" in format MMDDYY inside the shell script?

Need to increment the date from "currentdate + 90days" inside the for loop (i=1 to i=50) (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

awk "date" and "system" command

Hello experts! I need your help please I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.: 2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well. So I want to execute date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies

9. Solaris

Changing "rx_queue_number" in "ixgbe.conf". Reboot or Network Restart?

Hi all, First post here. Working on Solaris 10, on a Sun t4-4, need to change RX queue depth(ethernet, not HBA) and was wondering if i could get by with just restarting the network or if i should just bounce the whole shebang. Apologies if i missed a similar thread. if there is one, please... (2 Replies)
Discussion started by: caspnx
2 Replies

10. Windows & DOS: Issues & Discussions

Convert "hex" foldername to "ascii"

So, I have a folder, containing subdirs like this: 52334d50 52365245 524b4450 524f3350 52533950 52535050 52555550 now I want to go ahead and rename all those folder: hex -> ascii (8 Replies)
Discussion started by: pasc
8 Replies
reboot(2)							System Calls Manual							 reboot(2)

NAME
reboot - boot the system SYNOPSIS
DESCRIPTION
causes the system to reboot. howto is a mask of reboot options (see specified as follows: A file system sync is performed (unless is set) and the processor is rebooted from the default device and file. The processor is simply halted. A sync of the file system is performed unless the flag is set. should be used with caution. On systems with cellular architecture, all cells in the partition are rebooted in order to reconfigure the stable complex configuration data. On systems with non-cellular architec- ture, the default is A sync of the file system is performed unless the flag is set. Shut down the system firmware to a "ready to reconfigure" state and do not reboot. This option can be used only in combination with A sync of the file system is not performed. Unless the flag has been specified, reboot(2) unmounts all mounted file systems and marks them clean so that it will not be necessary to run fsck(1M) on these file systems when the system reboots. Only users with appropriate privileges can reboot a machine. RETURN VALUE
If successful, this call never returns. Otherwise, a -1 is returned and is set to indicate the error. ERRORS
fails if this condition is encountered: [EPERM] The effective user ID of the caller is not a user with appropriate privileges. DEPENDENCIES
The default file and device for is on the current root device. AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
reboot(1M), privileges(5). reboot(2)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy