As follow, I only want the command echo "this is to stdout"
output to my screen instead of to the file ok.log
, how can I do?
I search for the usage of exec
shell command, but without result, please advice me
[root@161 tmp]# bash --version
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
[root@161 tmp]# cat 2.sh
#!/bin/bash
exec 1>ok.log
exec 2>error.log
#exist dir
ls /home/
#no exist dir
ls /etca/
#to stdout
echo "this is to stdout"
#other cmds
...