Sponsored Content
Full Discussion: Date to epoch problem
Operating Systems OS X (Apple) Date to epoch problem Post 302561549 by Scott on Tuesday 4th of October 2011 12:04:34 PM
Old 10-04-2011
I just exported an "event" from iCal, ran your script and got no error (no output at all).

The generated file looks like this:

iCal_GeekLet:
Code:
" ============================================================================
" Netrw Directory Listing                                        (netrw v140)
"   /Users/scott/tmp/iCal_GeekLet
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
../

(no idea what any of this is about Smilie)

Can you add set -x under the #!/bin/bash and see if that helps us.

Also, can you say which .ics file it is working on when you get the error, and can you try eliminating that from the list?

Can you also change:
Code:
for i in `ls *.ics`; do

to
Code:
for i in *.ics; do

and change all references to it (${i}) to "$i" (surrounded with double quotes)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert date into epoch in Perl on Solaris

Solaris 10 doesn't seem to like me a lot. I am trying to run a simple script to accept date and return epoch of that date: #!/usr/bin/perl -w use strict; use Time::ParseDate; my($date1)="Mon Mar 27 05:54:08 CDT 2009"; chomp $date1; #Convert to seconds since start of epoch my $time1 =... (3 Replies)
Discussion started by: pavanlimo
3 Replies

2. Shell Programming and Scripting

Date to epoch problem

Hi all! I have a "simple" problem: I want to convert a date and time string (YYYYMMDDhhmmss) to epoch (unix time) in a shellscript. I want to use the "date/time" string as an input to the script, eg: scriptname.sh 20090918231000 and get the epoch format echoed out. Is there an... (3 Replies)
Discussion started by: condmaster
3 Replies

3. Shell Programming and Scripting

Need to convert an epoch date to MMDDYYHHmm format

System: HP-UX Kornshell Perl is installed, but not POSIX Hello, I am calculating a future date/time. To do this I take the system date in epoch format and add to it. I now need to take the new epoch date and convert it to MMDDYYHHmm format. Any help with this is greatly appreciated. (4 Replies)
Discussion started by: LetsGoPens
4 Replies

4. Shell Programming and Scripting

Get Formatted Date from Unix Epoch

Could someone please explain how to get a formatted date from the unix epoch (the number of seconds since Jan 1, 1970) For example., If the input is 1297969816, then the output should be 2011-02-17 in YYYY-MM-DD formatted manner. I am using AIX sh shell. Tried date -d and date --date, these... (4 Replies)
Discussion started by: Jesinth Nirmal
4 Replies

5. Shell Programming and Scripting

Date conversion from Standard/given format to seconds/epoch

I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates. Example : date -d "2007-09-01 17:30:40" '+%s' But this gives me below error date: illegal option -- d Usage: date OS: AIX... (6 Replies)
Discussion started by: bpaac
6 Replies

6. Programming

Converting a user inputted date to epoch time

Hi all , I need to know how to convert a time stamp entered by the user to be converted to GMT/UTC(epoch time) using mktime() and gmtime() for exapample the input will be put in the form ptm.tm_sec = 0; ptm.tm_min = 59; ptm.tm_hour = 11; ptm.tm_mday = 20;... (2 Replies)
Discussion started by: ada
2 Replies

7. Shell Programming and Scripting

Turning given date to epoch

i can probably script this in bash, but, i was wondering, does anyone know of a simple way to translate a given time to epoch? date -d@"29/Oct/2013:17:53:11" the user would specify the date: 29/Oct/2013:17:53:11 and the script will simply interpret that to epoch: 1348838383 (this is just... (4 Replies)
Discussion started by: SkySmart
4 Replies

8. Shell Programming and Scripting

Convert epoch time to Julian date

Need assistance in converting an epoch time to Julian date To get epoch perl -e 'use Time::Local; print timelocal(1,5,2,12,10,2008), "\n"' (3 Replies)
Discussion started by: ajayram_arya
3 Replies

9. Shell Programming and Scripting

Epoch time to produce exact date everytime

so i have to perform a certain task at set times. for instance, i need to run a job at 12:30am every night, and other jobs, i only need to have them run on saturdays. how do i manipulate the date command to give me the epoch equivalence of what 12:30am would be every day? im looking for a... (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies
SIP(1)                                                        General Commands Manual                                                       SIP(1)

NAME
sip - generates C++/Python bindings SYNOPSIS
sip [-h] [-V] [-a file] [-c dir] [-d file] [-e] [-g] [-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-P] [-r] [-s suffix] [-t tag] [-w] [-x feature] [-z file] [file] DESCRIPTION
sip takes a set of specification files and generates C++ code, documentation and build files. The format of the needed specification file is similar to a C++ header. sip includes run-time support for the generated code. OPTIONS
-h Show summary of options. -V Display the sip version number -a file The name of the QScintilla API file. If not indicated, it will not be generated. -b file The name of the build file. If not indicated, it will not be generated. -c dir The name of the directory where generated source file will be put. If not indicated, no code will be generated. -d file The name of the documentation file. If not indicated, no documentation will be generated. -e Enable support for exceptions. Disabled by default. -g Always release and reaquire the GIL. -I dir Directory where sip can search for included files. -j number Splits the generated code in number files (1 by default). This flag was added for parallel compilation on SMP machines. -m file The name of the XML export file. If not indicated, the file will not be generated. -p module Give the name of the consolidated module this module should be a part of. -P Enable the protected/public hack. -r Enable tracing on generated code. -s suffix The suffix used for generated C or C++ files (".c" or ".cpp" if none specified) -t tag The primary version to tag generate code for. You only can specify those defined with a %Timeline directive. If you don't specify one, sip will generate the latest available. -w Enable warning messages -x feature Disable a feature -z file The name of a file containing additional command line flags file The name of the file containing the specification. If you skip it, sip will expect to be fed by stdin. AUTHOR
This manual page was written by Ricardo Javier Cardenes Medina <rcardenes@debian.org> and Torsten Marek <shlomme@debian.org>, for the Debian GNU/Linux system (but may be used by others). 2010/02/02 SIP(1)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy