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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dd return values...

Status
Not open for further replies.

nkm

Programmer
May 27, 2001
45
US
Hi

I am trying to read a DAT tape using the dd command on Hp-Ux 11.

I wanted to know the return values for this command I have gone though the man pages and have found that if there is an error it returns >0 else 0.
What are the different return values for different error conditions. like end of tape or tape missing etc...
Is this documented anywhere.

Help would be greatly appreciated.

regards



 
Hi,

With dd you will normal get the error returned when the command is running , rather than just a prompt and you do an echo $? to get the return code .
SO you can run your command e.g.

dd if= ............ 2>/tmp/err.log

or if you do a trings on dd , errors listed are
dd: bad arg %s
dd: counts cannot be zero
dd: cannot open %s
dd: can't copy file onto itself
dd: cannot create %s
dd: %s: Not a valid input device when using files option
dd: not enough memory
dd read error
I/O error
I/O error
dd: invalid number specification in option
dd: %s Use a blocksize >= the logical block size %d

HTH
 
To find specfic error info.. You may want to review the
error.h file in /usr/include directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top