LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Capturing Output from net ads dns register Command (http://www.linuxquestions.org/questions/linux-general-1/capturing-output-from-net-ads-dns-register-command-800466/)

jfmorales 04-06-2010 08:37 PM

Capturing Output from net ads dns register Command
 
On Red Hat Enterprise Linux Server release 5.4, I'm trying to create a shell script that will register the system with a DNS server and capture the output of the command to a file. I have the following:

/usr/bin/net ads dns register -U MyUser%MyPassword > test.conf

The trouble is that no output ever shows up in the output file. If I remove the > test.conf, then I can see the output displayed, but I can't find a way to save it off to a file.

Note that I am able to capture output from other types of commands using > filename or >> filename at the end of the command. At seems like there's something special about this particular command that makes it difficult to capture output from it.

Thanks for any suggestions. --Joseph

unSpawn 04-07-2010 01:33 PM

Try '/usr/bin/net [args] 2>&1>test.conf' or (kind of lame) '/usr/bin/net [args] 2>/dev/null|tee /tmp/net.conf >/dev/null'?

jfmorales 04-07-2010 03:07 PM

>> Try '/usr/bin/net [args] 2>&1>test.conf' or (kind of lame) '/usr/bin/net [args] 2>/dev/null|tee /tmp/net.conf >/dev/null'?

Thanks unSpawn, I just gave these a try but they didn't succeed in capturing any output in the test.conf file.

Are there any other suggestions out there?

Joseph


All times are GMT -5. The time now is 07:56 PM.