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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Fermulator

  1. Fermulator

    How to handle large integers in Tcl8.4?

    Thanks to "dgp" on freenode for this tip! % set decBackToHex [format %lx $hexInDec] ffffffffffff As per the "OPTIONAL SIZE MODIFIER" notation on http://tmml.sourceforge.net/doc/tcl/format.html.
  2. Fermulator

    How to handle large integers in Tcl8.4?

    I'm trying to do some fancy footwork with HEX numbers. Basically, I want to take a HEX number, convert to decimal, add some number (integer) to it, and convert it back to HEX. % set hex 0xFFFFFFFFFFFF 0xFFFFFFFFFFFF % set hexInDec [expr $hex] 281474976710655 % set decBackToHex [format %x...
  3. Fermulator

    How to have Tcl run a find + grep

    Hi there! I'm trying to get Tcl to run a 'find this string in all of these files' type of command. From a shell (not Tcl), the following command works: find . -type f -exec grep -ni my_search_text /dev/null {} \; However, from Tcl, if we try to run: exec find . -type f -exec grep -ni $tag...
  4. Fermulator

    How to exec a binary and pass it args from a variable?

    HA! You ALMOST had it BONG! Your idea of using "append" had no affect, however, the idea of placing EXEC within the string worked! set strCmd "exec tar -X /tmp/tar-exclude -cvvf /tmp/myarchive.tar /dir/to/tar" eval $strCmd This is great. Thanks so much both of your for your help...
  5. Fermulator

    How to exec a binary and pass it args from a variable?

    PS: That error message is slightly massaged. The whole "ERROR: Could not compelete tar operation" and "Reason: " part are generated by my error catch proc. The "tar: /tmp/tar-exclude -cvvf /tmp/myarchive.tar /dir/to/tar: No such file or directory" is the raw output from tar failing.
  6. Fermulator

    How to exec a binary and pass it args from a variable?

    Still nothing: I'll give specific details here: exec tar -X /tmp/tar-exclude -cvvf /tmp/myarchive.tar /dir/to/tar Works. set tarArgs "-X /tmp/tar-exclude -cvvf $tmp/myarchive.tar $/dir/to/tar" exec tar $tarArgs ERROR: Could not complete tar operation Reason: tar: /tmp/tar-exclude -cvvf...
  7. Fermulator

    How to exec a binary and pass it args from a variable?

    Yes I'm positive it exists. I think the problem is that the 'exec' command typically works as: exec myexecutable arg0 arg1 arg2 However, when the args are stored as a variable: set args "args0 args1 args2" exec myexecutable $args it tries to pass "myexecutable" the args as an ENTIRE string...
  8. Fermulator

    How to exec a binary and pass it args from a variable?

    Trying: exec "tar $tarArgs" Results in: ERROR: Could not complete tar operation Reason: couldn't execute "tar -Xcvf /tmp/tar-exclude-file /tmp/MYFILE.tar /dir/to/tar": no such file or directory
  9. Fermulator

    How to exec a binary and pass it args from a variable?

    Having trouble getting exec to work with a dynamic set of arguments for the binary it's execing. Example: exec tar -cvf /tmp/MYFILE.tar /dir/to/tar This works, and the tar file is created. However, what if the 'arguments' passed into tar might change based on version? # If tar is newer...
  10. Fermulator

    Serial port communication

    I'm having the same type of question. I have some specific errors .. please see below ---- OS: Windows Vista Premium Tcl Version: 8.4 Goal: Looking for write capabilities with Serial Port. Code: # In Windows, we open a channel with "com1" =>set com [open com1: w] file14c4158 # Configure...

Part and Inventory Search

Back
Top