bash IO Redirection

SimpleScalar simulator가 출력을 stderr로 주고 있었다.
아래와 같이 stdout로 리다이렉션해서 출력했다.

$./sim-bpred <parameters> 2>&1

stderr와 stdout 모두 파일로 출력하고 싶다면, 다음과 같이 하면 된다[2].

$./sim-bpred <parameters> &>filename

References :
[1] Advanced Bash-Scripting Guide, Chapter 20. I/O Redirection, http://www.tldp.org/LDP/abs/html/io-redirection.html
[2] Redirect stderr and stdout in a bash script, stackoverflow, http://stackoverflow.com/questions/637827/redirect-stderr-and-stdout-in-a-bash-script

Advertisements
Tagged with: , , , , , ,
Posted in 2) Computer Engineering

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Recent Posts
누적 방문자 수
  • 144,076 hits
%d bloggers like this: