Rename files in Unix

From Rizzo_Lab
Revision as of 14:11, 10 March 2008 by Sudipto (talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

rename.sh

#!/bin/bash
for file in *rec.nohydrogens.pdb
do
       code=`echo $file|awk -F"." '{print $1}'`
       name=$code.rec.moe.pdb
       mv $file $name
done