I am little bit confused about redirections in linux.
command > file
command 1> file
command >> file.out 2>> file.err
(this is working as expected)commmand 1>>file.out 2>>file.err
(if command is successful , we get output log of command in file.err instead of in file.out
some guys said > and 1> are same but when used with commands not getting proper output.
for example ,
pg_dump -d postgres -t schemaname.table -v -f table.sql >>table.out 2>>table.err
if I execute above command , if command is successful , it should log the logs to table.log
and not in table.err
.
table.err
we get logs only in case pg_dump
status exit 1.
My expectation is we get log in table.out
when pg_dump
executed without any error while dumping tables. and we should get logs in table.err
when pg_dump
status is exit 1 or it's failed to dump tables.
Thanks!
command
do? We could explain what>
,1>
,>>
and1>>
do, and quote the manuals and the standard, but I wonder if it would help more to be able to tie that to your situation. – ilkkachu Oct 22 '21 at 15:33