title: Linux Shell Script For Each File in a Directory Grab the filename and execute a program
body: <p>Scenario :</p>
  
  <p>A folder in Linux system. I want to loop through every .xls file in a folder.</p>
  
  <p>This folder typically consists of various folders, various filetypes (.sh, .pl,.csv,...).</p>
  
  <p>All I want to do is loop through <strong>all files in the root</strong> and execute a program only on .xls files.</p>
  
  <p>Edit :</p>
  
  <p>The problem is the program I have to execute is 'xls2csv' to convert from .xls to .csv format. So, for each .xls file I have to grab the filename and append it to .csv. </p>
  
  <p>For instance, I have a test.xls file and the arguments fro xls2csv are : <code>xls2csv test.xls test.csv</code> </p>
  
  <p>Did I make sense?</p>