에코와 동시에 파일로 재지향 하려면..

dalmagi의 이미지

어떻게 해야 되나요?
예를들어 텔넷으로 작업하면서 그 화면으로 뿌려진 것들을 동시에 파일에 저장할 수 있게요.
그냥 리디렉션하면 화면이 안나와서 작업을 할 수가..^^;

recypace의 이미지

tee 라는 명령을 이용해 보세요.

telnet xxx 2>&1 | tee filename

자세한 것은 man tee

dalmagi의 이미지

와우 감사합니다 (__)

Fly me to the moon, and let me exit the world.

화이팅(fighting) 말고 화이트닝(whitening) 하면 안되나요.

윤봉환의 이미지

script 파일이름

새로운 셸이 뜨면서 이후 작업에서 화면에 표시되는 내용은 모두 지정한 파일이름으로 저장됩니다. 먼저 위 명령을 쓰고 새 셸에서 telnet 등 갈무리가 필요한 작업을 하면 됩니다.

갈무리를 마칠 때에는 exit라 쓰고 엔터..

放下着-----
내려놓으려는 마음도 내려놓기

juicy의 이미지

recypace 님의 글을 보고 테스트 해보았는데..
아래처럼 순서가 지켜지지 않는 문제점이 있습니다.
이거는 어떻게 해결할 수 있을까요?

$ ./a.out
1-stdout!!
2-stderr!!
3-stdout!!
4-stderr!!
 
$ ./a.out 2>&1 | tee b3.txt
2-stderr!!
4-stderr!!
1-stdout!!
3-stdout!!
 
$ cat b3.txt
2-stderr!!
4-stderr!!
1-stdout!!
3-stdout!!

윤봉환님 말대로 script 명령을 쓰면 이런 문제는 없을거 같긴한데..
키보드 입력의 불필요한 부분도 출력되는 문제가 있습니다.
예를 들면 키보드로 "abc"라고 입력할때,
"abd"를 입력한후, 백스페이스, 다시 "c"를 입력해서 "abc"라고 입력했을 때
script 명령으로 생성된 파일에는 백스페이스도 특수문자로 들어가서
"abd^Xc" 와 같이 나옵니다.

stdout/stderr의 순서도 지키고, 불필요한 키보드 입력은 받지 않는 좋은 방법 없을까요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.