[root@server /root]# ./cmd 1>out 2>err |
[root@server /root]# ./cmd 1>>out 2>>err |
[root@server /root]# (((./cmd | tee stdout) 3>&1 1>&2 2>&3\ |tee stderr) 3>&1 1>&2 2>&3) 1>out 2>err |
[root@server /root]# (cd /var/ftp/pub/rh71prof/disk1.iso.dir \ && tar -cvf - .) | (cd /var/ftp/pub/rh71prof/i386 && tar -xvf -) |
[root@server /root]# find . -type f -exec grep -i \ searchstring \{\} --with-filename \; |
#!/bin/sh #You can use this sample script for testing. The echo # statements explain how this script works. echo "This is Standard Out" >&1 echo "This is Standard Error" >&2 |
echo Standard Out >stdout.out echo Standard Error >stderr.out for X in bzImage modules modules_install; do make $X; done 1>>stdout.out 2>>stderr.out |
[root@server /root]# cmd | tee tee.out |
[root@server /root]# cmd | tee -a tee.out |
[root@server stdout]# script Script started, file is typescript [root@server stdout]# ./cmd This is Standard Out This is Standard Error [root@server stdout]# exit exit Script done, file is typescript [root@server stdout]# cat typescript Script started on Thu Oct 11 11:47:36 2001 [root@server stdout]# ./cmd This is Standard Out This is Standard Error [root@server stdout]# exit exit Script done on Thu Oct 11 11:47:39 2001 [root@server stdout]# |
[root@server /root]# cmd 2>&1 1>outfile |
[root@server /root]# cmd 1>outfile 2>&1 |
[root@server /root]# (((./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr) 3>&1 1>&2 2>&3) 1>out 2>err |
#!/bin/sh #You can use this sample script for testing. The echo # statements explain how this script works. echo "This is Standard Out" >&1 echo "This is Standard Error" >&2 |
[root@server /root]# ./cmd This is Standard Out This is Standard Error [root@server /root]# |
[root@server /root]# ./cmd | tee stdout |
[root@server /root]# (./cmd | tee stdout) |
[root@server /root]# (./cmd | tee stdout) 3>&1 1>&2 2>&3 |
[root@server /root]# (./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr |
[root@server /root]# ((./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr) |
[root@server /root]# ((./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr) 3>&1 1>&2 2>&3 |
[root@server /root]# (((./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr) 3>&1 1>&2 2>&3) |
[root@server /root]# (((./cmd | tee stdout) 3>&1 1>&2 2>&3 \ | tee stderr) 3>&1 1>&2 2>&3) 1>out 2>err |
[root@server /root]# ./cmd 1>out 2>err |