/tutorial/exec/cat.e

http://github.com/tybor/Liberty · Specman e · 31 lines · 27 code · 4 blank · 0 comment · 0 complexity · 7bd6780ae25d8b883c6378a27162204c MD5 · raw file

  1. class CAT
  2. create {ANY}
  3. make
  4. feature {}
  5. make
  6. local
  7. pf: PROCESS_FACTORY; p: PROCESS
  8. do
  9. p := pf.execute("cat", Void)
  10. from
  11. std_input.read_line
  12. until
  13. std_input.end_of_input
  14. loop
  15. p.input.put_string(std_input.last_string)
  16. p.input.put_new_line
  17. p.output.read_line
  18. std_output.put_string(p.output.last_string)
  19. std_output.put_new_line
  20. std_input.read_line
  21. end
  22. p.input.disconnect
  23. p.wait
  24. std_output.put_integer(p.status)
  25. std_output.put_new_line
  26. end
  27. end -- class CAT