f



error: "couldn't execute "date": no such file or directory" in Tk

hi,
 i am using the following code in a tcl script with the TK framework,
and i get the above error on executing the file main file..


main file
---------------
#!c:/tcl/bin/tclsh

label .l -text "click to execute"
button .b -text "Execute" -command "exec_script"

proc exec_script {} {
  set inp 1
  source sss.tcl
  puts $inp
}
pack .l .b



sss.tcl
-----------------------------
#!c:/tcl/bin/tclsh

set inp 0
puts $inp
set d [exec date]



The error i get is "couldn't execute "date": no such file or
directory"



I am using Tk with Tcl and it is necessary to print the date along
with along with my output.
The "exec date" works perfect in a tcl script only. but when i use it
along with TK i get the error...


i will be glad if someone could please help me...
 
thank you..

0
2/21/2007 11:42:28 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

7 Replies
2507 Views

Similar Articles

[PageSpeed] 15

On 21 Feb., 12:42, "ronnie" <maninder....@gmail.com> wrote:
> set d [exec date]
>
> The error i get is "couldn't execute "date": no such file or
> directory"

Since Tcl 7.6 or so, the [clock] function delivers date and time in a
portable way.
See http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm

Examples:
53615 % clock format [clock seconds]
Wed Feb 21 12:48:09 W. Europe Standard Time 2007
84 % clock format [clock seconds] -format %c
Mittwoch, 21. Februar 2007 12:48:21
53 % clock format [clock seconds] -format %Y-%m-%d,%H:%M:%S
2007-02-21,12:49:42

That [exec date] does work at times, and not at other times, can have
to do with a different PATH.

0
2/21/2007 11:50:20 AM
ronnie wrote:
> hi,
>  i am using the following code in a tcl script with the TK framework,
> and i get the above error on executing the file main file..
> 
> 
> main file
> ---------------
> #!c:/tcl/bin/tclsh
> 
> label .l -text "click to execute"
> button .b -text "Execute" -command "exec_script"
> 
> proc exec_script {} {
>   set inp 1
>   source sss.tcl
>   puts $inp
> }
> pack .l .b
> 
> 
> 
> sss.tcl
> -----------------------------
> #!c:/tcl/bin/tclsh
> 
> set inp 0
> puts $inp
> set d [exec date]
there seems to be no programm "date" in your path?


use [clock]
proc PointInTime {} {
	set second [ clock seconds ]
	# this returns an ISO 8601 format timestring, fix to your liking
	# see man n clock
	return [ clock format $second -gmt 1 -format "%Y%m%dT%T" ]
}

ISO 8601 point-in-time
	An ISO 8601 point-in-time specification, such as CCyymmd-
	dThhmmss,  where  T is the literal T, CCyymmdd hhmmss, or
	CCyymmddThh:mm:ss.
any other format spec for clock format is possible.

uwe
0
2/21/2007 12:04:13 PM
On Feb 21, 5:04 pm, Uwe Klein <uwe_klein_habertw...@t-online.de>
wrote:
> ronniewrote:
> > hi,
> >  i am using the following code in a tcl script with the TK framework,
> > and i get the above error on executing the file main file..
>
> > main file
> > ---------------
> > #!c:/tcl/bin/tclsh
>
> > label .l -text "click to execute"
> > button .b -text "Execute" -command "exec_script"
>
> > proc exec_script {} {
> >   set inp 1
> >   source sss.tcl
> >   puts $inp
> > }
> > pack .l .b
>
> > sss.tcl
> > -----------------------------
> > #!c:/tcl/bin/tclsh
>
> > set inp 0
> > puts $inp
> > set d [exec date]
>
> there seems to be no programm "date" in your path?
>
> use [clock]
> proc PointInTime {} {
>         set second [ clock seconds ]
>         # this returns an ISO 8601 format timestring, fix to your liking
>         # see man n clock
>         return [ clock format $second -gmt 1 -format "%Y%m%dT%T" ]
>
> }
>
> ISO 8601 point-in-time
>         An ISO 8601 point-in-time specification, such as CCyymmd-
>         dThhmmss,  where  T is the literal T, CCyymmdd hhmmss, or
>         CCyymmddThh:mm:ss.
> any other format spec for clock format is possible.
>
> uwe- Hide quoted text -
>
> - Show quoted text -

hi,
 thank you dear friends.. i was very glad to see my friends uwe and
suchenwi have come out to help me.. your help was very useful and your
suggestions worked well.. thank you very much..
 also i came with another solution to my problem..
 since i did not want to replace the date function that was used.. i
set the path to date.exe in the environment variable PATH of
windows... the date.exe is located in the cygwin\bin directory.. and
hence the "exec date" function ran in successfully..
                             thank you very much once again..
 
keep up the good work :)
 
and take care

0
2/22/2007 7:23:06 AM
On Feb 21, 5:04 pm, Uwe Klein <uwe_klein_habertw...@t-online.de>
wrote:
> ronnie wrote:
> > hi,
> >  i am using the following code in a tcl script with the TK framework,
> > and i get the above error on executing the file main file..
>
> > main file
> > ---------------
> > #!c:/tcl/bin/tclsh
>
> > label .l -text "click to execute"
> > button .b -text "Execute" -command "exec_script"
>
> > proc exec_script {} {
> >   set inp 1
> >   source sss.tcl
> >   puts $inp
> > }
> > pack .l .b
>
> > sss.tcl
> > -----------------------------
> > #!c:/tcl/bin/tclsh
>
> > set inp 0
> > puts $inp
> > set d [exec date]
>
> there seems to be no programm "date" in your path?
>
> use [clock]
> proc PointInTime {} {
>         set second [ clock seconds ]
>         # this returns an ISO 8601 format timestring, fix to your liking
>         # see man n clock
>         return [ clock format $second -gmt 1 -format "%Y%m%dT%T" ]
>
> }
>
> ISO 8601 point-in-time
>         An ISO 8601 point-in-time specification, such as CCyymmd-
>         dThhmmss,  where  T is the literal T, CCyymmdd hhmmss, or
>         CCyymmddThh:mm:ss.
> any other format spec for clock format is possible.
>
> uwe- Hide quoted text -
>
> - Show quoted text -

hi,
 thank you dear friends.. i was very glad to see my friends uwe and
suchenwi have come out to help me.. your help was very useful and
your
suggestions worked well.. thank you very much..
 also i came with another solution to my problem and i thought i
should share it with you also..
 since i did not want to replace the date function that was used.. i
set the path to date.exe in the environment variable PATH of
windows... the date.exe is located in the cygwin\bin directory and it
is the function that fetches the system date.. after this the "exec
date" function ran in successfully..
                             thank you very much once again..
 
keep up the good work :)

 
and take care



0
2/22/2007 7:35:26 AM
On Feb 21, 6:42 am, "ronnie" <maninder....@gmail.com> wrote:
> hi,
>  i am using the following code in a tcl script with the TK framework,
> and i get the above error on executing the file main file..
:
> The error i get is "couldn't execute "date": no such file or
> directory"

> The "exec date" works perfect in a tcl script only. but when i use it
> along with TK i get the error...

For some reason, you are getting a different set of directories in
your PATH when you run the tcl script than when you run the Tk script.
Or perhaps the Tcl script adds some directories to the PATH
environment variable.

0
lvirden (1938)
2/22/2007 11:31:11 AM
At 2007-02-22 02:35AM, "ronnie" <maninder.vit@gmail.com> wrote:
[...]
>  hi,
>   thank you dear friends.. i was very glad to see my friends uwe and
>  suchenwi have come out to help me.. your help was very useful and
>  your


So what's up with the random From: addresses?  You also sent this reply
as: "Ranjan" <ranjan.kapoor@gmail.com>

-- 
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
0
glennj (645)
2/22/2007 2:28:27 PM
On Feb 22, 7:28 pm, Glenn Jackman <gle...@ncf.ca> wrote:
> At 2007-02-22 02:35AM, "ronnie" <maninder....@gmail.com> wrote:
> [...]
>
> >  hi,
> >   thank you dear friends.. i was very glad to see my friends uwe and
> >  suchenwi have come out to help me.. your help was very useful and
> >  your
>
> So what's up with the random From: addresses?  You also sent this reply
> as: "Ranjan" <ranjan.kap...@gmail.com>
>
> --
> Glenn Jackman
> "You can only be young once. But you can always be immature." -- Dave Barry

:-) o yes.. mr. ranjan my project manager had logged on to my system
earlier, since we are on the same project, so he didn't sign out as a
result my post came up in his name earlier... :-)

0
2/23/2007 4:29:46 AM
Reply:

Similar Artilces:

""""""""""""""""""""""ADD ME""""""""""""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfo Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... We look forward to build a ve...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

Urgent Requirement in """""""""""""NEW YORK""""""""""""""""
Hello Partners, Please find the requirement below. Please send the updated resume along with rate and contact no. REQ#1: Title : Java Developer ( Rating Project) Duration : 6 months Rate : open Location : NY strong java, WebLogic 9.2, Web Services, Oracle REQ#2: Title : Java Developer Duration : 4 months Rate : open Location : NY Strong java, SQL REQ#3: Title : VB.Net Consultant Location : NY Duration : 4 months Rate : open Primarily looking at someone who has Excel, VB.net a...

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

"If then; if then;" and "If then; if;"
I have a raw data set which is a hierarchical file: H 321 s. main st P Mary E 21 F P william m 23 M P Susan K 3 F H 324 S. Main St I use the folowing code to read the data to creat one observation per detail(P) record including hearder record(H): data test; infile 'C:\Documents and Settings\retain.txt'; retain Address; input type $1. @; if type='H' then input @3 Address $12.; if type='P' then input @3 Name $10. @13 Age 3. @16 Gender $1.; run; but the output is not what I want: 1 321 s. main H 2 321 s. main P Mary E 21 F 3 321 s...

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

Urgent Requirement for """""""""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting ...

Urgent need """""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting Database/ETL requirements (Optional) ...

A problem about "[ ]" "( )" "="
I want to read several images saved in a director,and give them to I1,I2 ,I3....,using the following codes: filelist=dir(['c:\MATLAB701\work\...\*.jpg']); for i=1 :length(filelist) I=imread(fullfile('c:\MATLAB701\work\...',filelist(i).name)); end; but failed. Then I used I(i)=imread... ,still failed. How could I do? "John" <mailofww@126.com> wrote in message news:ef19e12.-1@webx.raydaftYaTP... >I want to read several images saved in a director,and give them to > I1,I2 ,I3....,using the following codes: > filelist=dir(['c:\MATLAB701\work\.....

Does it need a ";" at the very after of "if" and "for"
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if statement? marsarden said: > write code like: > > int main(void) > { > int a=10; > if(a<20) > {} > } > > Compiler ok on dev-cpp . don't we have to add a ";" after if > statement? The syntax for 'if' is: if(expression) statement There is no semicolon after the ) but before the statement. The statement is either a normal statement (which can be empty), ending in a semicolon:- if(expr) ...

"In" "Out" and "Trash"
I just bought a new computer and I re-installed Eudora Light on my new computer. But when I open Eudora, the "In", "Out" and "Trash" links are not on the left side of the screen the way they were on my old computer. How can I get these links back on the left side of the screen? Thank you. On 25 Mar 2007 09:49:22 -0700, "abx" <abfunex@yahoo.com> wrote: >I just bought a new computer and I re-installed Eudora Light on my new >computer. But when I open Eudora, the "In", "Out" and "Trash" links >are ...

'echo "": No such file or directory" error using "exec" to pipe in PHP script
[TCL] set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts [exec "echo '$php' | php -q"] [/TCL] When I try this within TCL I get the following error: [quote] echo "": No such file or directory [/quote] I am unable to be able to use the CLI PHP "php -r" option due to my PHP installations on various servers being CGI and not CLI SAPI, else, I would just do that, so I'm trying an alternative that is choking TCL. I am using a very simple example within the TCL $php variabl...

(mapcar 'quote '("1" "2" "3" "4"))
(mapcar 'quote '("1" "2" "3" "4")) returns ((quote "4") (quote "4") (quote "4") (quote "4")) Interesting and (for me) unexpected. Because (mapcar 'read '("1" "2" "3" "4")) returns (1 2 3 4) and (mapcar 'princ '("1" "2" "3" "4")) gives 1234("1" "2" "3" "4") Why isn't (mapcar 'quote '("1" "2" "3" "4&q...

Urgent JAVA Requirement in """"""NEW YORK"""""""""
Hello Partners, How are you ? Please find the requirement below. Location : NY Duration : 8 mnths Rate :Open Job description: Java/J2EE Web Service Developer =B7 (4+ years of application development experience in Java/J2EE and Web service technologies. =B7 Experience with spring & Hibernate. =B7 Experience with J2EE Application Server (preferably Web logic). =B7 Preferable Aqua logic DSP Experience =B7 Preferable Sonic ESB Composite Service experience Experience w...

function "strftime" produce "No such file or directory" error
Hello, everyone. This is a test program that generates undesired results when cross compiling with eldk-4.0. It is strange that localtime_r sets errno to ENOENT at the first time, but never again in the following calls, while strftime always sets errno to ENOENT. But errno will never be set if run on Ubuntu 12.04.4, or Debian 7. Can someone help me? This is the output: # ./test_timegen 1st errno = 0, Success 2nd errno = 2, No such file or directory 3rd errno = 2, No such file or directory 2000-01-05 04:12:11.661426 1st errno = 0, Success 2nd errno = 0, Success 3rd errno = ...

Gary Sokolich """"""
"""""""""" http://www.manta.com/c/mmlq5dm/w-gary-sokolich W Gary Sokolich 801 Kings Road Newport Beach, CA 92663-5715 (949) 650-5379 http://www.tbpe.state.tx.us/da/da022808.htm TEXAS BOARD OF PROFESSIONAL ENGINEERS February 28, 2008 Board Meeting Disciplinary Actions W. Gary Sokolich , Newport Beach, California �V File B-29812 - It was alleged that Dr. Sokolich unlawfully offered or attempted to practice engineering in Texas (...) Dr. Sokolich chose to end the proceedings by signing a Consent Order that was accepted by ...

Question about "sprintf" "@" "do for"
Hello, this works: A1=3D1 A2=3D2 A3=3D3 i=3D1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari i=3Di+1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari i=3Di+1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari do for [i=3D1:3]{ vari=3Dsprintf("A%.f",i) print vari } But I want to have "print vari,"=3D",@vari" in the loop. But it dosen't=20 work. Why can't I use "print vari,"=3D",@vari" in the loop? Is there a=20 solution for? J=C3=B6rg Jörg ...

puts "\\".gsub("\\", "\\\\")
Hello, I have a mini-ruby quiz. Guess what this line of code writes to the console, then try it for yourself: puts "\\".gsub("\\", "\\\\") Why is that so? Martin From: martinus [mailto:martin.ankerl@gmail.com]=20 # Hello, I have a mini-ruby quiz. Guess what this line of code writes to # the console, then try it for yourself: # puts "\\".gsub("\\", "\\\\") puts "\\".gsub("\\", "\\\\") \ #=3D> nil # Why is that so? faq. escaping the escape in sub/gsub. search the archives. maybe you want somethin...

[Q] How to escape "\a" "\b" "\c" "\f" "\n" "\r" "\t" "\v" in the string output?
Hi, there. Belows are some example strings which stand for M$ Windows directory path. How can I escape the special meanings like "\a", "\n", "\r" in these M$ Windows directory name strings? C:\amail\dir1\nbar C:\bmail\dir2\tbar C:\cmail\dir3\afoo C:\fmail\dir4\vfoo C:\nmail\dir5\fbar C:\rmail\dir6\abar C:\tmail\dir7\vfoo C:\vmail\dir8\cfoo Thanks in advance. In article <1161145522.072002.20370@m7g2000cwm.googlegroups.com>, "yh" <y.hosang@gmail.com> wrote: > Hi, there. > > Belows are some example strings which stand for M$ Wi...

Help! Can't read file with the char's. " / " and "." !
&nbsp; Hi fellows! &nbsp; I got this file : example.&nbsp;&nbsp; &nbsp; 13-06-06 12:30:20,526&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-3,568&nbsp; 13-06-06 12:30:20,529&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-13,528 13-06-06 12:30:20,556&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-30,568 .. .. ..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; My program writes this file, and in my program i also got a&nbsp; ReadFile.VI, to read this file and plot...

Web resources about - error: "couldn't execute "date": no such file or directory" in Tk - comp.lang.tcl

Resources last updated: 2/15/2016 11:49:48 AM