Search Results

Search: Posts Made By: vrupatel
1,147
Posted By Skrynesaver
perl -Mstrict -e 'sub iso_stamp{ my...
perl -Mstrict -e 'sub iso_stamp{
my $epoch=shift;my @time=localtime($epoch);
return sprintf "%04d-%02d-%02d.%02d.%02d",$time[5]+1900,$time[4]+1,@time[3,2,1];
}
my...
1,147
Posted By PikK45
I would suggest you to have these timestamps in a...
I would suggest you to have these timestamps in a file which will not be modified by any other process.

So, for the first run of the script you can print "TimeBefore" to $CURRENT_DATE. The other...
1,219
Posted By Makarand Dodmis
trydos2unix update.sh update.shthen run the...
trydos2unix update.sh update.shthen run the scriptupdate.sh 1
2,149
Posted By Corona688
Perl is about the only portable option for date...
Perl is about the only portable option for date math, and as perl oneliners go that's both short and readable.
2,149
Posted By rbatte1
Let's try this then:-date +%Y-%m-%d-%H.%M.%S ...
Let's try this then:-date +%Y-%m-%d-%H.%M.%S
perl -e 'use POSIX qw(strftime);print scalar(strftime "%Y-%m-%d-%H.%M.%S" , localtime(time - 300)), "\n";' The first date is just to show the difference....
2,149
Posted By rbatte1
With the fairly common -d flag not being...
With the fairly common -d flag not being available for AIX, I've cobbled together this:-date
perl -e 'print scalar localtime(time - 300), "\n";'THis gives you the calculation, but the output may not...
4,172
Posted By Akshay Hegde
use this sed -i.bak "2s/=.*/=$(date...
use this sed -i.bak "2s/=.*/=$(date +"%Y-%m-%d-%H.%M.%S" )/" file
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
4,172
Posted By Scrutinizer
The common way is to redirect the output output...
The common way is to redirect the output output to a new file.
some_cmd file > newfile

If the output is correct then you can replace the old file with the new file. If that file is important, you...
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy