SED output problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > SED output problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SED output problem  
lac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:25 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register