Hi guys,
I want to automate a few tasks. For one of them, I need to get the output of a command and parse it to extract information I need: drbdadm create-md drbd0
The output is:
md_offset 48010952704
al_offset 48010919936
bm_offset 48009453568
Found ext2 filesystem which uses 18563076 kB
current configuration leaves usable 46884232 kB
==> This might destroy existing data! <==
Do you want to proceed?
[need to type 'yes' to confirm]
Now, I need to enter no at this stage so that I could get the size only. What I do is:
Quote:
test=`drbdadm create-md drbd0 | grep "current configuration leaves usable"` << MAYDAY
no
MAYDAY
But, this requires me to press enter at the command prompt before it finishes the execution.
How do I get rid of that extra enter? Anybody? please help!
Thanks