Subject: Non-interactive mode and errors

From: Narcis Garcia <[email-masked]>
Date: Sat, 16 Jan 2016 20:03:21 +0100

Hello, I'm trying to use parted to get details from block devices in a
Shell Script, but when I run this for an empty removable device:

parted /dev/mydevice print

Returns:
Error: Error opening /dev/mydevice: No medium found
Retry/Cancel?

and doesn't end until user interaction.
Is there any way to avoid this, and simple get the message error and status?

Thanks.