Using the exec command 
Author Message
 Using the exec command

I have been having a rough time getting the tcl parser to take a pipe in the
exec command such as this one below:

set temp [exec du -sk /.cache/swap | nawk '{print $1}']

It often complains about the $1 not being a recognized variable so I can put
a "\" delimiter in front of it but then it prints out the result of the du
command followed by |0nawk0'{print0$1}'

Any idea the best way to exec sub-processes and pipe commands together and
set a variable to the result?

Please email me direct.

Thanks.

Chris



Mon, 12 Jan 1998 03:00:00 GMT  
 Using the exec command

Hi,

Yeah I am a newbie to tcl/tk and to this newsgroup also. I think tcl/tk is very
cool but unfortunatly I have had zero luck getting the hang of it! I have programmed
maily in korn shell in the past but have done Bourne, Csh, C, C++ I am trying to learn
Tcl/Tk from John K. Ousterhout's book. I am used to using all of the Unix Util's such
as nawk, sed, grep, sort. I often pipe a lot of these together and set a variable to
the result. This is a snap in Korn Shell but I can't do it in tcl yet I am really
stumped trying to get exec to do anything other than one simple command at a time.

Can someone suggest a good way for me to do those kinds of things with pipes? Is
exec the wrong command? When do I use eval? Also I am a bit confused what are the
differences in binding a command to a widget or using -command option on the widget?

Last but not least is there a way to display a scale that changes with a variables
state but does not give the using a slider button, or at least disables the slider?

Thanks alot, and I'll keep reading the book.

Chris



Mon, 12 Jan 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Issues using the exec command in Windows ME?

2. Probelm with using UNIX source command with exec

3. strange when exec commands using expect.

4. How to exec print command using NT

5. Using '*'in exec command on UNIX

6. Using exec to run a command with quoted arguments

7. Bug using EXEC command without any shell ...

8. using shell pipe and variables in Tcl exec command

9. problems running commands (like sed) using exec.

10. freewrap exec command and source command

11. Problem with exec command: error reading output from command: interrupted

12. using exec in windows nt exec on tcl scripts

 

 
Powered by phpBB® Forum Software