title: What is batch file equivalent in Mac to move all files with .dat extension to another folder in a usb drive
body: <p>I need to create a script to move all the files with certain extension from root of USB1 to specificFolder.</p>
  
  <p>So far I have created a move.command file with this code</p>
  
  <pre><code>#!/bin/bash
  mv /VOLUMES/USB1/*.dat /VOLUMES/USB1/specificFolder 
  </code></pre>
  
  <p>and I am setting x bit on the file to make it executable with</p>
  
  <pre><code>chmod +x move.command 
  </code></pre>
  
  <p>When I double click the file to launch, terminal opens up and this message is displayed
  /Volumes/USB1/move.command ; exit;
  logout
  [Process completed]</p>
  
  <p>But files are not moved over. 
  What am I missing?</p>