Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. tCarls

    Makefile: setting variables to output of commands

    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...
  2. tCarls

    copy group permission to other permission

    Here's a bash script that seems to work. #!/bin/sh for file in ${@}; do r=`ls -l $file | cut -c5` w=`ls -l $file | cut -c6` x=`ls -l $file | cut -c7` if [[ $r == "r" ]]; then chmod a+r $file else chmod a-r $file fi...
  3. tCarls

    Tcl/Tk script-start by double click instead of calling from CLI

    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 ...
  4. tCarls

    interactive shell within perl program?

    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`;
  5. tCarls

    Comment more than one line in vi

    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...
  6. tCarls

    exec and after...

    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...
  7. tCarls

    vi Question

    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...
  8. tCarls

    make a new window with chart/diagram

    Use toplevel to create a new window. button .but -text OK pack .but toplevel .newWindow button .newWindow.but2 -text OK pack .newWindow.but2
  9. tCarls

    tcl help needed, probably very simple to you

    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...
  10. tCarls

    Simple sed Parsing

    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.
  11. tCarls

    Simple sed Parsing

    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...
  12. tCarls

    Simple sed Parsing

    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...
  13. tCarls

    Using Scrollbars without Text

    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 }...

Part and Inventory Search

Back
Top