Group: comp.lang.tcl


Subject: need help
From: Glenn Jackman
Date: 11/25/2007 4:20:03 PM
At 2007-11-25 07:45AM, "wayne_wang@shu.edu.cn" wrote: > I write a tcl file, test.tcl , then chmod +x test.tcl , and the > program can be run which command--tclsh test.tcl > but the program can not be run which command----test.tcl or ./ > test.tcl > > and the error information is > puts: command not found > > why do the program can not be run ? > > #!/usr/bin/tclsh > puts stdout "hello,world"; Is this a file you created on windows and transferred to a *nix machine? Make sure you have no carriage returns at line end. Try using dos2unix on your file. -- Glenn Jackman "You can only be young once. But you can always be immature." -- Dave Barry

Subject: need help
From: Glenn Jackman
Date: 11/26/2007 4:42:35 PM
At 2007-11-26 06:55AM, "wayne_wang@shu.edu.cn" wrote: > thank you for helping me > now I show my procedure as Keith Nash do > > server280-2% ls -al test.tcl > -rwxrwxrwx 1 tr03 user 100 Nov 26 19:43 test.tcl > server280-2% cat test.tcl > #!/disk2/software/mentor/calibre200703/ss5_cal_2007.3_18.11/bin/tclsh > puts stdout "hello,world"; > server280-2% which tclsh > /disk2/software/mentor/calibre200703/ss5_cal_2007.3_18.11/bin/tclsh > server280-2% tclsh test.tcl > hello,world > server280-2% ./test.tcl > puts: Command not found > > > I wonder why ??? pleas help me Try this: od -c test.tcl Do you see something like this: 0000000 # ! / u s r / l o c a l / b i 0000020 n / t c l s h \n Or after the "t c l s h" do you see "\r \n" ? What text editor do you use? -- Glenn Jackman "You can only be young once. But you can always be immature." -- Dave Barry