1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh files=$(ls) for file in files do tmp=$(echo $dir | sed 's/.cpp//') mkdir $tmp mv $file $tmp cd .. done