LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-06-2010, 08:37 PM   #1
jfmorales
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Rep: Reputation: 0
Question 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
 
Old 04-07-2010, 01:33 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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'?
 
Old 04-07-2010, 03:07 PM   #3
jfmorales
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Original Poster
Rep: Reputation: 0
>> 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
 
  


Reply

Tags
script, shell



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing output from background FTP command Lazypete Linux - Server 6 05-22-2008 10:41 AM
Perl: Running Command line apps in background and capturing output s0l1dsnak3123 Programming 8 03-28-2008 01:24 PM
expect_out(buffer) is not capturing all output from a Cisco IOS command eentonig Programming 1 01-30-2008 07:29 AM
net join ads command Steve1445 Linux - Networking 4 02-25-2005 07:44 AM
"net ads join" command not found with samba 3.0.2a tisource Linux - Networking 2 04-15-2004 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration