LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2007, 02:34 PM   #1
teabag_46
Member
 
Registered: Aug 2007
Posts: 35

Rep: Reputation: 15
bash equivalent of <perl -e 'print time'>


Hi, I am trying to find the bash equivalent of <perl -e 'print time'> which prints the number of seconds since the epoch (January 1st 1970).

I have tried google, and also man time, man clock and man times. If I have missed something obvious please let me know.

This is for a personal project, not homework, and there is no real rush.

Thanks.
 
Old 10-23-2007, 02:42 PM   #2
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
date --date='2007-10-23 20:41:00 GMT' +%s

%s is number of seconds since the epoch

Last edited by The_JinJ; 10-23-2007 at 02:44 PM.
 
Old 10-23-2007, 03:04 PM   #3
teabag_46
Member
 
Registered: Aug 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for that.

I had missed something obvious!

Last edited by teabag_46; 10-23-2007 at 03:07 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
bash equivalent to C increment operator andrewb758 Linux - General 5 02-21-2009 12:25 PM
Bash: Print usage statement & exit; otherwise continue using Bash shorthand operators stefanlasiewski Programming 9 02-07-2006 05:20 PM
The perl equivalent... Ateo Programming 4 04-09-2005 02:23 AM
bash equivalent to tcsh's \!* tdp05 Programming 1 09-03-2004 04:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration