#!/bin/bash

if [ $# -ne 1 ]; then echo "alo"; exit; fi

#for spectrum in $1; 
#do  
#	if [ -e tmp.prg ]; rm tmp.prg; fi
spectrum="$1"
	sed -e 's/name/'$(echo ${spectrum/.fits})'/g' midas_elodie.prg > tmp.prg
	echo "Processing... $spectrum"
	/home/ana/midas/09FEBpl1.0/system/unix/inmidas < tmp.prg
#done	
