I'm trying to run a command that is dependent on all files within a directory. I could do something like this:
test : dir/* dir/dir2/* dir/dir3/* ... etc
run command
But it would be much easier if I could do this (it doesn't work):
files = `find dir/`
test : $(files)
run command
Is...
To tell it how to run the script the first line needs to be #! followed by the path to the interpreter. If you're using Linux you can use /usr/bin/wish for a tcl/tk gui. Like this:
#!/usr/bin/wish
code ...
I don't really understand what you're trying to do, but you can start a shell from within a perl script by enclosing it within back quotes. For example, to open a bash shell from within a perl script you could the following. Hope this helps.
#!/usr/bin/perl
`bash`;
If you use vim you can use block visual mode. Go to the beginning of the first line you want to comment, press ctrl-v to enter block visual mode, press j until you reach the last line you want to comment, press I (capital) to enter insert mode, then press # and esc and all the lines you selected...
Hmmm, it's hard to know when a script finishes when it's in the background. How about writing a dummy shell script that calls all your scripts and puts them in the background? Then you call that from tcl in the foreground and you would know when it's done. Probably not the best solution, but it...
It sounds like you're thinking about folds, although they only work in vim, not vi. To create folds, first "set foldmethod=manual", then use "zf" to fold text. If you're editing a C file you can use "set foldmethod=syntax" to have vim create the folds for you. Use "zo" to open a fold and "zc" to...
To force tcl1 one to wait for tcl2 to finish; don't put exec tcl2 in the background. Also, you need to close out1.tr before tcl2 can read it. This seems to work for me:
proc tcl1 { } {
set out1 [open out1.tr w]
puts $out1 "procedure1 line1"
close $out1
exec tclsh...
Wow, that makes a world of difference. I actually ended up
rewriting the entire bash script in C, which no script
stands a chance against in terms of speed, but it's still
good to know. Thanks a lot.
I'm running about 100 of these scripts in the background.
I have a GUI written in tcl/tk built around a bash script
and it's these few lines of parsing that's taking the
most effort and slowing everything else down.
I looked into it more and it turns out it's not so
much sed that takes too long...
I'd like to print only the part of a line enclosed
in parenthesis. For example:
input: junk_VAR1=12_junk_VAR2=231_junk
output: 12
In perl (this is too slow) it would be something like:
print ($line =~ /VAR1=(\d+)/);
Right now I'm substituting the entire line with \1, which
is faster than...
Is it possible to associate a scrollbar with a widget
other than text? I'm using more frames than will fit
on the screen. I'd like to do something similar to
the following:
#!/usr/bin/wish
for {set i 0} {$i < 100} {incr i} {
button .$i -text button
grid .$i -row $i -column 0
}...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.