Created
March 15, 2014 07:49
-
-
Save suimye/9563150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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