Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Include PERL script with in the unix shell script Post 302190378 by jim mcnamara on Tuesday 29th of April 2008 12:18:14 PM
Old 04-29-2008
example:
Code:
#!/bin/ksh
# print the epoch time in seconds when a file was last modified
# filename = $1
perl -e ' $mtime=(stat $ARGV[0])[9]; print "$mtime\n"; ' "$1"

 

10 More Discussions You Might Find Interesting

1. Programming

How to include shell script in C program

hi I want to call a shell script in C program the script is : ssh -t user@remote sh /<remote>home/user/<file_name>.sh and other several commands C program : Call this script and the retrive the task that is been done in <file_name>.sh file can any one tell me how... (5 Replies)
Discussion started by: mridula
5 Replies

2. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

3. Shell Programming and Scripting

how to include spreadsheet::ParseExcel in shell script

Please tell me that how can we include Spreadsheet::ParseExcel module in shell script (1 Reply)
Discussion started by: akash
1 Replies

4. Shell Programming and Scripting

How to include a command in shell script?

# dbc "delete from alert;" DELETE 10 # However, the script created below generates an error that command does not exits. Can any one please exist. script.sh: #!/bin/sh dbc "delete from alert;" >>$TASKLOGFILE ./script.sh: line 38: dbc: command not found can any one please... (2 Replies)
Discussion started by: sureshcisco
2 Replies

5. Shell Programming and Scripting

include virtual perl-script - submit button opens a new page..

hello 2 all I can't understand how to insert a perl-script into .shml in a right way. <form> should be working but it's not doing that: <!--#include virtual="/cgi-bin/script.cgi?filename"--> filename is a name of the file which script is using the script is used for a score show (the number... (0 Replies)
Discussion started by: tip78
0 Replies

6. Web Development

include virtual perl-script - submit button opens a new page..

hello 2 all I can't understand how to insert a perl-script into .shml in a right way. <form> should be working but it's not doing that: <!--#include virtual="/cgi-bin/script.cgi?filename"--> filename is a name of the file which script is using the script is used for a score show (the number... (3 Replies)
Discussion started by: tip78
3 Replies

7. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

8. Shell Programming and Scripting

Need to access Oracle DB with shell/perl script in Unix

Hi, We need to access Oracle DB with shell/perl script in Unix. Is Oracle client needed in Unix for this. I have seen threads which tell abt using SQL plus to access Oracle tables. Can we access DB without SQL PLus installation using scripts in UNix like we access DB using jar files in Java .... (1 Reply)
Discussion started by: justinacc
1 Replies

9. Shell Programming and Scripting

Apache Hosting-Shell Script - external files include

Hi there Well, it's my first time on this board, so short to myself: I'm matibaski, working as a webdeveloper and also as a system administrator on ubuntu server machines. The problem: I created a small apache-hostingscript by myself and it works fine. But after some addings and new... (1 Reply)
Discussion started by: matibaski
1 Replies

10. Shell Programming and Scripting

How to include menu based options in Shell script?

Hi Friends, I have a menu based tool which requires input/option to proceed further. How to make a shell script ? eg: menu looks like Get_data.sh to continue (y/n) : Here I need to key in "y" to proceed. I want to prepare a script which should consider option y. (5 Replies)
Discussion started by: suresh3566
5 Replies
DateTime::Format::Epoch::MacOS(3pm)			User Contributed Perl Documentation		       DateTime::Format::Epoch::MacOS(3pm)

NAME
DateTime::Format::Epoch::MacOS - Convert DateTimes to/from Mac OS epoch seconds SYNOPSIS
use DateTime::Format::Epoch::MacOS; my $dt = DateTime::Format::Epoch::MacOS->parse_datetime( 1051488000 ); DateTime::Format::Epoch::MacOS->format_datetime($dt); # 1051488000 my $formatter = DateTime::Format::Epoch::MacOS->new(); my $dt2 = $formatter->parse_datetime( 1051488000 ); $formatter->format_datetime($dt2); # 1051488000 DESCRIPTION
This module can convert a DateTime object (or any object that can be converted to a DateTime object) to the number of seconds since the Mac OS epoch. Note that the Mac OS epoch is defined in the local time zone. This means that these two pieces of code will print the same number of seconds, even though they represent two datetimes 6 hours apart: $dt = DateTime->new( year => 2003, month => 5, day => 2, time_zone => 'Europe/Amsterdam' ); print $formatter->format_datetime($dt); $dt = DateTime->new( year => 2003, month => 5, day => 2, time_zone => 'America/Chicago' ); print $formatter->format_datetime($dt); Mac OS X is a Unix system, and uses the Unix epoch (1970-01-01T00:00:00). Use DateTime::Format::Epoch::Unix instead. METHODS
Most of the methods are the same as those in DateTime::Format::Epoch. The only difference is the constructor. o new() Constructor of the formatter/parser object. It has no parameters. SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHOR
Eugene van der Pijll <pijll@gmx.net> COPYRIGHT
Copyright (c) 2003 Eugene van der Pijll. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
DateTime datetime@perl.org mailing list perl v5.10.1 2007-12-03 DateTime::Format::Epoch::MacOS(3pm)
All times are GMT -4. The time now is 06:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy