TCL clock scan


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TCL clock scan
# 1  
Old 06-15-2012
TCL clock scan

the below shown clock manipulation works well in Linux machine which has TCL 8.5. But when i use the same on the SunOS which has the TCL8.4 , I am getting the error "bad switch "-format": must be -base or -gmt".

For some reason, I am not able to upgrade my TCL 8.4 to 8.5 in SunOS.

Can anyone please help, how can I make it work in TCL 8.4 as well?????

The Commands are given below and what I am trying to achieve through these commands is to advance the system date by one more day.

$today contains the value "2012 06 15 14 39 20"

set today [clock scan $today -format "%Y %m %d %H %M %S"]
set tomorrow [clock add $today 86600 seconds]
set victim [clock format $tomorrow -format "%a"]
set tomorrow [clock format $tomorrow -format "%m%d%H%M"]
send "sudo date $tomorrow\r"

Thanks

Last edited by prakasuj; 06-15-2012 at 02:37 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Showing Clock

Is it possible to display the clock (timing) on the screen all the time. (3 Replies)
Discussion started by: vino.paal
3 Replies

2. Programming

problem with clock()

#include<iostream> #include<time.h> using namespace std; int main() { system("date"); clock_t start = clock(); int i=9*8; while(i--) { int j=9999999; while(j--); } clock_t end = clock(); double elapsed =... (4 Replies)
Discussion started by: johnbach
4 Replies

3. Solaris

Bugs with clock()

Hi there!!! Need your help in solving some tricky problems. Since clock() as such is buggy on SUN OS 5 we have started using gettimeofday() in our RTOS applications based on Solaris 9. The problems we actually encountered previously were - the applications kind of freeze/hang eternally on... (1 Reply)
Discussion started by: smanu
1 Replies

4. UNIX for Advanced & Expert Users

clock change

Hi We had a AIX box built last year but was set to the correct GMT time, but using DST time zone. In march this year the clocks went forward without issues. (if I remember a couple of weeks early due to the DST zone) This year we decided to change the clock to the correct time zone before... (0 Replies)
Discussion started by: markab2
0 Replies

5. UNIX for Dummies Questions & Answers

clock() call returning zero always

Hi, Is there a chance that the clock() call returns 0 eternally??? Using BSD. My RTOS application freezes inconsistently only on particular hosts. When debugging it, I came to see that the RTOS timer does not tick at times. The underlying system call is clock() & it always returns zero when the... (4 Replies)
Discussion started by: smanu
4 Replies

6. Programming

clock() function

Hey all, i need a program to get the CPU ticks at certain points of my program. So, i thought about using the clock function, but i'm having a hard time figuring out how it really works. I wrote this simple program to try to understand it but it made me feel more confused: #include <stdio.h>... (5 Replies)
Discussion started by: kastrup_carioca
5 Replies

7. UNIX Desktop Questions & Answers

hardware (BIOS) clock

Guys could you please tell me which appropriate command is used to set hardware (BIOS) clock so that the system keeps time when it reboots & how it's used. I use Linux Thank you (2 Replies)
Discussion started by: joseph kembo
2 Replies

8. UNIX for Dummies Questions & Answers

Clock Trouble

Hey ppl, i was wonddering, in mandrake, how to get the clok to display the time in non-military format....hehe thank you im just tired of looking at 18:00 hehe thank you (2 Replies)
Discussion started by: LolapaloL
2 Replies
Login or Register to Ask a Question
clock_getres(3) 					     Library Functions Manual						   clock_getres(3)

NAME
clock_getres - Gets the resolution for the specified clock (P1003.1b) LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <time.h> int clock_getres ( clockid_t clock_id, struct timespec *res); PARAMETERS
clock_id The clock type used to obtain the resolution. The CLOCK_REALTIME clock is supported and represents the TIME-OF-DAY clock for the system. *res A pointer to the timespec data structure that receives the value of the clock's resolution. DESCRIPTION
The clock_getres function returns the resolution value for the specified clock. If the res argument is NULL, the clock resolution is not returned. RETURN VALUES
On a successful call, a value of 0 (zero) is returned. On an unsuccessful call, a value of -1 is returned and errno is set to indicate that an error occurred. ERRORS
The clock_getres function fails under the following condition: [EINVAL] The clock_id argument does not specify a known clock. RELATED INFORMATION
Functions: time(1), ctime(3), timer_settime(3) Guide to Realtime Programming delim off clock_getres(3)