What is the syntax for that? Is the following syntax for that?Hai sunray.,
We can send using command line arguments in tcl................
Environmental variables can be used by defining in one file itself.. but u should define before u call... So define all environmental variable in the initial file..........
command line arguments:-
syntax for command line arguments in tcl
Syntax:-
tclsh filename.tcl $variable_name
Declaring as variable is local so u cant call outside that specific program
1.
refer this
https://www.edaboard.com/threads/263542/
To be more understandable
tclsh filename.tcl a b c
puts "[lindex $argv 0]"
puts "[lindex $argv 1]"
puts "[lindex $argv 2]"
will print a b and c..
2.
if u use set to declare a variable its local u cannot call it in other programs u can pass it as arguments..
3. #!/usr/bin/env
Normally #!/usr/bin will have some necessary builtin functions to use that functions we need to define this....
1. No your syntax is wrong u cant set envirnonmental variable like this in tclsh
2. no u cant call outside
3. no need.. its not compulsary..
Try to pass the variable through command line or through procedures with arguments to share things to other files
Its like stdio.h in c
It will have some buit in function..
i
no u cant able to access the value of variable in two separate file untill its an environmental variable. if u want to access pass as command line arugments thats it..
i
u know whats the use of stdio.h its will have input and output function like printf and scanf if ur code doesnt have printf and scanf u dont need stdio.h in c..
likewise here did u used anything specific from #!/usr/bin/env if not then why u r worrying about that........?
Hai sunray,
#!/usr/local/bin/tclsh
but would be non portable as tclsh might be installed in /bin or /bin/local
#!/usr/bin/env tclsh
is a method allowing a portable way to specify to the OS a full path equivalent to the actual one where tclsh is first located in the PATH.
Inside this it will contains all the files necessary files needed for tclsh
It will mention the tclsh installed path.. pointing to the whole tclsh lib bundle
So it will not have much impact over your code which u wrote inside.. Even if u leave this command it wont hurt u..
not exactly like that it will have the path where all necessary files will be there..
To be more understandble we can say it as installed path..
if u include that statement it shows ur installed path is this..
it would be more understandable if u read this.. it shows the usage if u set like this..
**broken link removed**
**broken link removed**
**broken link removed**
go through these three links u will get somewhat what i am coming to say..
acutally u went through that right.., Also there will be lots of options like that did u note that??
.
running the code with and without that command for a normal tclsh program u will not feel any difference until u dont used some builtin commands.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?