Skip to content

Instantly share code, notes, and snippets.

@zhhailon
Created October 21, 2011 06:36
Show Gist options
  • Save zhhailon/1303244 to your computer and use it in GitHub Desktop.
Save zhhailon/1303244 to your computer and use it in GitHub Desktop.
Make some dirs according to existing files and copy the file into the corresponding dir.
#! /bin/bash
k8_dir=~/Documents/lab/k8/
k8_java_dir="$k8_dir"/k8_java/
dest_dir=~/src/
for full_name in `ls "$k8_java_dir"`; do
name=${full_name%*.mht}
echo $name
dir="$dest_dir""$name"
`mkdir "$dir"`
echo "$dir created"
`cp "$k8_java_dir""$full_name" "$dir"`
echo "File $full_name copied"
`touch "$dir"/TestCase.java`
echo "TestCase.java created"
echo "====================="
done
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment