title: BASH KDialog multiple file input - split string on certain space
body: <p>I'm using kdialog's file selection dialog to help me select multiple files and store the location of said files into an array. Unfortunately the string that is captured by kdialog has a whitespace as a delimiter. So kdialog essentially retrieves a string that looks like this:</p>
  
  <p>/home/file 1.jpg /home/file 2.jpg /home/file 3.jpg</p>
  
  <p>I'm essentially trying to split this string so it would look like this;</p>
  
  <p>/home/file 1.jpg </p>
  
  <p>/home/file 2.jpg </p>
  
  <p>/home/file 3.jpg</p>
  
  <p>(without the newline in between the lines. I had to add those newlines in because SO was trying to put them all in one line). I tried using this code to split it </p>
  
  <pre><code>IFS=' /' read -r -a array &lt;&lt;&lt; "$variable"
  </code></pre>
  
  <p>But it wasn't working. Prior to using kdialog, I was using zenity's file selection dialog, which has an output like this:</p>
  
  <p>/home/file 1.jpg|/home/file 2.jpg|/home/file 3.jpg</p>
  
  <p>That output was easier to split with this code;</p>
  
  <pre><code>IFS='|' read -r -a array &lt;&lt;&lt; "$variable"
  </code></pre>
  
  <p>But kdialog's thumbnails can be resized while zenity couldn't, hency why I'm trying to use kdialog.</p>
  
  <p>Any help would be greatly appreciated. Thanks.</p>