Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help writing shell script! Post 302725799 by ctsgnb on Friday 2nd of November 2012 04:19:49 PM
Old 11-02-2012
Sorry but i still don't understand what is the point.
Logging the start and end time into a log should be sufficient.

Code:
$ cat example.sh
MYLOG=my_log_$(date +%Y%m%d_%H%M%S).out
exec >>$MYLOG 2>&1
date
echo start sleeping
sleep 10
date
exec >&-
$ sh example.sh
$ ls -rt | tail -1
my_log_20121102_210927.out
$ cat my_log_20121102_210927.out
vendredi 2 novembre 2012, 21:09:27 (UTC+0100)
start sleeping
vendredi 2 novembre 2012, 21:09:37 (UTC+0100)
$

Code:
$ cat example2.sh
date >mylog2.out
echo "Run some random prog" >>mylog2.out
sleep 10 >>mylog2.out
date >>mylog2.out
$ sh example2.sh
$ cat mylog2.out
vendredi 2 novembre 2012, 21:15:52 (UTC+0100)
Run some random prog
vendredi 2 novembre 2012, 21:16:02 (UTC+0100)
$

?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with writing shell script

I have the following output. I want to write a script to check for 1. waits > 0 on all rowsand Ratio > .0. if true then send email. ========================= ROLLBACK SEGMENT CONTENTION ========================= If any ratio is > .01 then more rollback segments are needed NAME ... (1 Reply)
Discussion started by: jigarlakhani
1 Replies

2. UNIX for Dummies Questions & Answers

Writing a shell Script

How to write a shell script file to read 5 numbers using a while loop. Finding the average, maximum and minumum for the numbers. Any help would be great. (1 Reply)
Discussion started by: Chin
1 Replies

3. Shell Programming and Scripting

Need help for writing shell script

Hello ALL, I am fresher in Unix . i need help to write small shell script . Please help me unix guru. I am developing the internal site in my office . the data files are generated in one directory everyday . I have to write shell script to sort those files and put it is internal site . ... (3 Replies)
Discussion started by: deepa20
3 Replies

4. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

5. Shell Programming and Scripting

Writing shell script

Hi, I am a new for shell script. i need to write script using the following commands cd /usres/test # create directory mkdir temp+DATE( i need to append date ) #moving files from one directory to this directory(we need to check total files in source and taget) cd /users/sample ... (2 Replies)
Discussion started by: bmkreddy
2 Replies

6. Shell Programming and Scripting

Need help in writing the shell script

Can anyone please help me in writing a shell script that would check if a particular user(xyz) has logged in, and if yes, the audit daemon needs to be started. When the user logs off the dameon needs to shutdown , and the report needs to be e-mailed to a set of users. (12 Replies)
Discussion started by: ggayathri
12 Replies

7. UNIX and Linux Applications

Need help in writing shell script

I have written a shell script and when i ran the script,for some point of time it is asking to press enter key manually using keyboard.So i need it the enter key in shell itself. ex : in my shell script,i used the command ssh-keygen -t rsa so it asks the enter 3 times. can you please let me know... (3 Replies)
Discussion started by: lkeswar
3 Replies

8. Shell Programming and Scripting

Writing a shell script

Hi I have two files a.log and b.log . i need to append a.log and b.log so that at the end of first line in a.log i need the append the data of first line from b.log and end of the second line in a.log i need to append the data of second line from b.log and so on up to the end of the file can... (3 Replies)
Discussion started by: lalu
3 Replies

9. Shell Programming and Scripting

Need help writing shell script!

Hi, I'm very new to this, so bear with me please. I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (2 Replies)
Discussion started by: ShiGua
2 Replies

10. UNIX for Dummies Questions & Answers

Need help in writing shell script

Dear Team, Below is the list of steps i need to perform manually as of now and completely new to shell scripting, could you help in writing a shell script to perform the below procedure? 1. Log in to primary DNS server 2. Check /etc/named.conf if zone is already created (grep –i... (2 Replies)
Discussion started by: VKIRUPHAKARAN
2 Replies
DateTime::Locale::fr_MC(3)				User Contributed Perl Documentation				DateTime::Locale::fr_MC(3)

NAME
DateTime::Locale::fr_MC SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'fr_MC' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for French Monaco. DATA
This locale inherits from the DateTime::Locale::fr locale. It contains the following data. Days Wide (format) lundi mardi mercredi jeudi vendredi samedi dimanche Abbreviated (format) lun. mar. mer. jeu. ven. sam. dim. Narrow (format) L M M J V S D Wide (stand-alone) lundi mardi mercredi jeudi vendredi samedi dimanche Abbreviated (stand-alone) lun. mar. mer. jeu. ven. sam. dim. Narrow (stand-alone) L M M J V S D Months Wide (format) janvier fevrier mars avril mai juin juillet aout septembre octobre novembre decembre Abbreviated (format) janv. fevr. mars avr. mai juin juil. aout sept. oct. nov. dec. Narrow (format) J F M A M J J A S O N D Wide (stand-alone) janvier fevrier mars avril mai juin juillet aout septembre octobre novembre decembre Abbreviated (stand-alone) janv. fevr. mars avr. mai juin juil. aout sept. oct. nov. dec. Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1er trimestre 2e trimestre 3e trimestre 4e trimestre Abbreviated (format) T1 T2 T3 T4 Narrow (format) T1 T2 T3 T4 Wide (stand-alone) 1er trimestre 2e trimestre 3e trimestre 4e trimestre Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide avant Jesus-Christ apres Jesus-Christ Abbreviated av. J.-C. ap. J.-C. Narrow av. J.-C. ap. J.-C. Date Formats Full 2008-02-05T18:30:30 = mardi 5 fevrier 2008 1995-12-22T09:05:02 = vendredi 22 decembre 1995 -0010-09-15T04:44:23 = samedi 15 septembre -10 Long 2008-02-05T18:30:30 = 5 fevrier 2008 1995-12-22T09:05:02 = 22 decembre 1995 -0010-09-15T04:44:23 = 15 septembre -10 Medium 2008-02-05T18:30:30 = 5 fevr. 2008 1995-12-22T09:05:02 = 22 dec. 1995 -0010-09-15T04:44:23 = 15 sept. -10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 5 fevr. 2008 1995-12-22T09:05:02 = 22 dec. 1995 -0010-09-15T04:44:23 = 15 sept. -10 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = mardi 5 fevrier 2008 18:30:30 UTC 1995-12-22T09:05:02 = vendredi 22 decembre 1995 09:05:02 UTC -0010-09-15T04:44:23 = samedi 15 septembre -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 5 fevrier 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 decembre 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 septembre -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 5 fevr. 2008 18:30:30 1995-12-22T09:05:02 = 22 dec. 1995 09:05:02 -0010-09-15T04:44:23 = 15 sept. -10 04:44:23 Short 2008-02-05T18:30:30 = 05/02/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/09/-10 04:44 Default 2008-02-05T18:30:30 = 5 fevr. 2008 18:30:30 1995-12-22T09:05:02 = 22 dec. 1995 09:05:02 -0010-09-15T04:44:23 = 15 sept. -10 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 mar. 1995-12-22T09:05:02 = 22 ven. -0010-09-15T04:44:23 = 15 sam. HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (EEE d/M) 2008-02-05T18:30:30 = mar. 5/2 1995-12-22T09:05:02 = ven. 22/12 -0010-09-15T04:44:23 = sam. 15/9 MMd (d/MM) 2008-02-05T18:30:30 = 5/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = fevr. 1995-12-22T09:05:02 = dec. -0010-09-15T04:44:23 = sept. MMMd (d MMM) 2008-02-05T18:30:30 = 5 fevr. 1995-12-22T09:05:02 = 22 dec. -0010-09-15T04:44:23 = 15 sept. MMMdd (dd MMM) 2008-02-05T18:30:30 = 05 fevr. 1995-12-22T09:05:02 = 22 dec. -0010-09-15T04:44:23 = 15 sept. MMMEd (E d MMM) 2008-02-05T18:30:30 = mar. 5 fevr. 1995-12-22T09:05:02 = ven. 22 dec. -0010-09-15T04:44:23 = sam. 15 sept. MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 fevrier 1995-12-22T09:05:02 = 22 decembre -0010-09-15T04:44:23 = 15 septembre MMMMEd (EEE d MMMM) 2008-02-05T18:30:30 = mar. 5 fevrier 1995-12-22T09:05:02 = ven. 22 decembre -0010-09-15T04:44:23 = sam. 15 septembre mmss (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (M/yyyy) 2008-02-05T18:30:30 = 2/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 9/-010 yMEd (EEE d/M/yyyy) 2008-02-05T18:30:30 = mar. 5/2/2008 1995-12-22T09:05:02 = ven. 22/12/1995 -0010-09-15T04:44:23 = sam. 15/9/-010 yMMM (MMM y) 2008-02-05T18:30:30 = fevr. 2008 1995-12-22T09:05:02 = dec. 1995 -0010-09-15T04:44:23 = sept. -10 yMMMEd (EEE d MMM y) 2008-02-05T18:30:30 = mar. 5 fevr. 2008 1995-12-22T09:05:02 = ven. 22 dec. 1995 -0010-09-15T04:44:23 = sam. 15 sept. -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = fevrier 2008 1995-12-22T09:05:02 = decembre 1995 -0010-09-15T04:44:23 = septembre -10 yQ ('T'Q y) 2008-02-05T18:30:30 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 yQQQ (QQQ y) 2008-02-05T18:30:30 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyMMM (MMM yy) 2008-02-05T18:30:30 = fevr. 08 1995-12-22T09:05:02 = dec. 95 -0010-09-15T04:44:23 = sept. -10 yyMMMd (d MMM yy) 2008-02-05T18:30:30 = 5 fevr. 08 1995-12-22T09:05:02 = 22 dec. 95 -0010-09-15T04:44:23 = 15 sept. -10 yyMMMEEEd (EEE d MMM yy) 2008-02-05T18:30:30 = mar. 5 fevr. 08 1995-12-22T09:05:02 = ven. 22 dec. 95 -0010-09-15T04:44:23 = sam. 15 sept. -10 yyQ ('T'Q yy) 2008-02-05T18:30:30 = T1 08 1995-12-22T09:05:02 = T4 95 -0010-09-15T04:44:23 = T3 -10 yyQQQQ (QQQQ yy) 2008-02-05T18:30:30 = 1er trimestre 08 1995-12-22T09:05:02 = 4e trimestre 95 -0010-09-15T04:44:23 = 3e trimestre -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = fevrier 2008 1995-12-22T09:05:02 = decembre 1995 -0010-09-15T04:44:23 = septembre -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week lundi SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::fr_MC(3)
All times are GMT -4. The time now is 03:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy