[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

redirecting the output with sudo

Is there a way to do this in one single command?

$wajig doc > /tmp/wajig_doc.txt
$sudo mv /tmp/wajig_doc.txt /root/wajig_doc.txt

ie I want to redirect the output of a command to a file and store this in a directory owned by root. Is there a way to achieve the above with a single command?

I have tried

$sudo wajig doc > /root/wajig_doc.txt

But it does not work. Using Debian sid, bash 3.00.16(1).


Kamaraju S Kusumanchi

Reply to: