05-24-06 12:17 AM
Hi,
I have been trying to call SED from TCL using the exec function and it
behaves differently then if I called the same SED function from the
shell (command line).
I am trying to extract only certain lines from a file as follow:
sed -n '5,10p' $Filename
If I type this from the command line in ksh, I get what I expect, lines
5 to 10 are printed to standard output.
However, if I try to call that same function within TCL using exec,
nothing returns.
catch {exec ksh -c "sed '5,10p' $Filename"} content
I have tried not using -n on sed but then all the file gets printed to
standard output when called from command line with duplicates of lines
5 to 10. When I don't use the -n flag from withing TCL (with exec), all
the file is printed without duplicates of line 5 to 10.
Can someone help me with this? I don't understand what is happening
here?
Thank you,
lac
[ Post a follow-up to this message ]
|