Even with the -m and/or -s option which are supposely designed to make
parted machine-readable, it still mixes error messages and warnings on
stdout.  In practice this makes it not machine-readable at all.

Example:

$ truncate -s 1M /tmp/test1.img
$ parted -m -- /tmp/test1.img unit b print
WARNING: You are not superuser.  Watch out for permissions.
Error: /tmp/test1.img: unrecognised disk label                            
BYT;
/tmp/test1.img:1048576B:file:512:512:unknown:;

The "WARNING:..." and "Error:..." lines go to stdout.

These patches fix most of the problems, sending errors and warnings to
stderr where they belong.  Parsing can now be attempted more sanely:

$ ~/d/parted/parted/parted -m -- /tmp/test1.img unit b print 2>/dev/null
BYT;                                                                      
/tmp/test1.img:1048576B:file:512:512:unknown:;

Rich.


_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/parted-devel

Reply via email to