title: how do I get over parted confirmation request in a script
body: <p>I wonder if anybody has done this sort of stuff:</p>
  
  <p>I need to use parted in a script doing a bit of a dodgy operation. I am trying to modify an extended partition that contains the partition I have been booted on so I am getting a confirmation request that leads to an error exit in script mode. </p>
  
  <p>When I do this manually it works.</p>
  
  <p>So I tried to pipe my input into parted to get around this with the following script:</p>
  
  <pre><code>#!/usr/bin/env bash
  parted /dev/sda &lt;&lt; EOT
  resizepart
  4
  y
  33593343s
  Yes
  I
  EOT
  </code></pre>
  
  <p>This does not work unfortunately.  I get  </p>
  
  <pre><code>root@19912ac:/tmp# ./test.sh 
  GNU Parted 3.2
  Using /dev/sda
  Welcome to GNU Parted! Type 'help' to view a list of commands.
  (parted) resizepart                                                       
  Partition number? 4                                                       
  Warning: Partition /dev/sda4 is being used. Are you sure you want to continue?
  (parted) y                                                              
    align-check TYPE N                     
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  ...
  </code></pre>
  
  <p>It looks like all goes well until I am asked to confirm the modification of /dev/sda4. My next input (y) shows up on the command line but after that I only get help infos.</p>
  
  <p>Anybody tried this before ? </p>