Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

put results into file?? 1

Status
Not open for further replies.
Oct 17, 2006
227
I have this command which checks the read of the tape as Ive had a couple of issues.


dd if=/dev/st0 of=/dev/null

how would you move the reults into a file eg test1.txt

Thanks

 
Code:
dd if=/dev/st0 of=/dev/null > test1.txt

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
As this is a test, you might want to pipe both STDOUT and STDERR to your file.
Code:
dd if=/dev/st0 of=/dev/null [red]2>&1[/red] test1.txt

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Hi Steve

Couple of things
dd if=/dev/st0 of=/dev/null


brings up

dd: reading `/dev/st0': Input/output error
0+0 records in
0+0 records out

if I put this into a file dd if=/dev/st0 of=/dev/null >
it creates a blank file!!!


if I use your command above
dd if=/dev/st0 of=/dev/null 2>&1 test2.txt
it comes up

dd: unrecognized option `test2.txt'
Try `dd --help' for more information.

Basically I want whatever this prints into a file so it can be moved and emailed.
 
What shell are you using?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
dd writes to STDOUT by default. Maybe try
Code:
dd if=/dev/st0 of=/dev/null [red]2>[/red] test1.txt
to just pick up STDERR?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Good. Not sure what results you'll get if the dd command works properly, rather than failing, however...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
dd sends all of its informational and error output to stderr, so that should be fine.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top