Skip to content

Instantly share code, notes, and snippets.

@bxshi
Created April 23, 2014 00:59
Show Gist options
  • Save bxshi/11199532 to your computer and use it in GitHub Desktop.
Save bxshi/11199532 to your computer and use it in GitHub Desktop.
cp & rename files
#!/bin/bash
FILES="./*.txt"
DEST="/afs/dropbox"
SUFIX=".txt"
for f in $FILES
do
echo "${f:2}"
TMP=${f:2}
NAME=${TMP%$SUFIX}
echo "${NAME}"
`cp $f ${DEST}/${NAME}/project4_result.txt`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment