Skip to content

Instantly share code, notes, and snippets.

@suimye
Created March 15, 2014 07:49
Show Gist options
  • Save suimye/9563150 to your computer and use it in GitHub Desktop.
Save suimye/9563150 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "This program compress bed files to zip files in the folder"
echo "last update 2012.3.11 ........................................."
#Retrive filenames
Files=`ls`
m2=0
for var2 in $Files;
do
echo "in var2 file $var2"
if [[ "$var2" =~ ".bed" ]];then
ARRAY2[$m2]=$var2
m2=`expr $m2+1`
fi
done
for afile in "${ARRAY2[@]}";
do
echo "data is...........................$afile"
case $afile in
*.bed)
bfile=$(echo $afile | sed 's/.bed//;')
;;
esac
eval "zip $bfile.zip $afile";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment