<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Loop over with all files in a directory in bash]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/34693/loop-over-with-all-files-in-a-directory-in-bash?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/34693/loop-over-with-all-files-in-a-directory-in-bash?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/34693/loop-over-with-all-files-in-a-directory-in-bash</guid>
	<pubDate>Sat, 16 Dec 2017 20:23:51 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/34693/loop-over-with-all-files-in-a-directory-in-bash</link>
	<title><![CDATA[Loop over with all files in a directory in bash]]></title>
	<description><![CDATA[<code>#!/bin/bash
FILES=/media/ComparativeGenomics/ncbi-genomes-2017-11-13/*
ref=/media/ComparativeGenomics/ncbi-genomes-2017-11-13/GCA_000196735.1_ASM19673v1_genomic.fna
path=/home/urbe/Tools/SATSUMA/satsuma-code-0
for f in $FILES
do
  if [ ${f: -4} == &quot;.fna&quot; ]; then
  echo &quot;Processing $f file...&quot;
  ff=$(basename &quot;${f%.*}&quot;)
echo $ff
  # take action on each file. $f store current file name
  mkdir $ff
  $path/SatsumaSynteny -q $ref -t $f -o $ff
  #cat $f
  fi
done</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>