#!/bin/bash
function jarmv(){
for file in ` ls $1`
doif [ -d$1"/"$file ] #如果 file存在且是一个目录则为真then
jarmv $1"/"$fileelse
jarpath=$1"/"$file
reg=.*jar
if [[ \"$jarpath\" =~ $reg ]]; then
echo $jarpath
sudo mv $jarpath "/home/dragon/workspace/scala/jar"
fi
fi
done
}
INIT_PATH="/home/dragon/workspace/scala/deeplearning4j"
jarmv $INIT_PATH
#!/bin/bash
function copy(){
for file in ` ls $1`
doif [ -f$1"/"$file ] #then
copy_path=$1"/"$fileifecho$file|grep .*nc
thenecho$copy_pathsudo mv $copy_path"/home/..."fifidone
}
INIT_PATH="/home/..."
copy $INIT_PATH