Shell Script (c) redirection

First on a map:

code show as below:

#!/bin/bash

echo "hello world"
echo `ls +`

Results are as follows:

 

PS:

1. If you want to redirect data to a file at the same time and stdout, you can use the tee command.

2. -: used to redirect stdout or stdin

echo "hello world" | cat -

 

References:

http://man.linuxde.net/tee

Shell input / output redirection

Reproduced in: https: //www.cnblogs.com/gattaca/p/7223153.html

Guess you like

Origin blog.csdn.net/weixin_34015566/article/details/93524960