03-26-2007
Yeah, this story was there on slashdot a couple of weeks ago... pretty cool!
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I have problems executing a script in ksh with this script named
process.sh:
ps -ef | grep process.sh | grep -v grep | wc -l | read a
if
then
echo "The script is running"
exit 0
fiThe problem is that when I execute the script, sometimes it shows the
message "The script is... (10 Replies)
Discussion started by: jguirao
10 Replies
2. Ubuntu
Hi to all,
I have the problem that a laptops with windows XP cannot startup even in safe mode nor using last good known configuration. I have a Ubuntu 10.10 Live CD and booting from it I can read the Hard Drive.
I need to do a backup the Hard Drive from XP laptop and I want to connect this... (5 Replies)
Discussion started by: cgkmal
5 Replies
3. Shell Programming and Scripting
How to combine 3 find statements into 1-liner?
find statements:
cd ${dir1} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"
cd ${dir2} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l... (4 Replies)
Discussion started by: ux4me
4 Replies
4. UNIX for Dummies Questions & Answers
If I run:
find /somefolder -type f -size -7M | wc -l
I get 73594 files
But when I run
find /somefolder -type f -size -7M -exec /bin/cp -v {} /someotherfolder/ \;
it only copies 38891 of the files to the folder, why? There's a mix of all types of files in /somefolder. Is there some other... (12 Replies)
Discussion started by: unclecameron
12 Replies
5. Shell Programming and Scripting
I must go through some files to change a certain string within text files to another string. I use openSUSE and folders are mounted by cifs.
Text to be replaced (only in .m extension) is U:\FOLDER and new string is N:
That works fine with spaces in directory names etc., but this process ... (5 Replies)
Discussion started by: Pappa41
5 Replies
6. BSD
I used to use x86 Linux clients for this years ago, but ceased all activity until last night. I have resurrected an old Sun Blade 100, which used to run Solaris 9, when I first owned it, in the 2003 period, but now is very much alive with 2 gig of new ram, and and extra 10 gig of drive space... (0 Replies)
Discussion started by: RichardET
0 Replies
7. Ubuntu
Dear all,
I would like to transfer my old laptop documents/files etc to the new laptop without using any external hard disk.
Please let me know if its possible via any way.
Thank in advance,
emily (3 Replies)
Discussion started by: emily
3 Replies
8. Shell Programming and Scripting
Hi,
How would you write bash script that given a directory as an argument and finds all duplicate files (with same contents - by using bytewise comparison) there and prints their names? (6 Replies)
Discussion started by: elior
6 Replies
9. UNIX for Beginners Questions & Answers
The contents of my home directory:
bin Desktop Documents Downloads folders Music Pictures Public Templates Videos
When I run the command for file in /home/myself/*d*; do if ; then echo $file; fi; doneit finds
/home/myself/Downloads
/home/myself/Videos
but not "folders".
... (5 Replies)
Discussion started by: Xubuntu56
5 Replies
LEARN ABOUT DEBIAN
time::seconds
Time::Seconds(3perl) Perl Programmers Reference Guide Time::Seconds(3perl)
NAME
Time::Seconds - a simple API to convert seconds to other date values
SYNOPSIS
use Time::Piece;
use Time::Seconds;
my $t = localtime;
$t += ONE_DAY;
my $t2 = localtime;
my $s = $t - $t2;
print "Difference is: ", $s->days, "
";
DESCRIPTION
This module is part of the Time::Piece distribution. It allows the user to find out the number of minutes, hours, days, weeks or years in a
given number of seconds. It is returned by Time::Piece when you delta two Time::Piece objects.
Time::Seconds also exports the following constants:
ONE_DAY
ONE_WEEK
ONE_HOUR
ONE_MINUTE
ONE_MONTH
ONE_YEAR
ONE_FINANCIAL_MONTH
LEAP_YEAR
NON_LEAP_YEAR
Since perl does not (yet?) support constant objects, these constants are in seconds only, so you cannot, for example, do this: "print
ONE_WEEK->minutes;"
METHODS
The following methods are available:
my $val = Time::Seconds->new(SECONDS)
$val->seconds;
$val->minutes;
$val->hours;
$val->days;
$val->weeks;
$val->months;
$val->financial_months; # 30 days
$val->years;
$val->pretty; # gives English representation of the delta
The usual arithmetic (+,-,+=,-=) is also available on the objects.
The methods make the assumption that there are 24 hours in a day, 7 days in a week, 365.24225 days in a year and 12 months in a year.
(from The Calendar FAQ at http://www.tondering.dk/claus/calendar.html)
AUTHOR
Matt Sergeant, matt@sergeant.org
Tobias Brox, tobiasb@tobiasb.funcom.com
BalieXXzs SzabieXX (dLux), dlux@kapu.hu
LICENSE
Please see Time::Piece for the license.
Bugs
Currently the methods aren't as efficient as they could be, for reasons of clarity. This is probably a bad idea.
perl v5.14.2 2011-09-19 Time::Seconds(3perl)