Using various combinations of shell syntax to achieve C files, java file sorting
(1) themselves create a new folder, the name of self-created
(2) in the folder below to create multiple files c and java files, the name of self-created
(3) write a script to achieve under the current folder to c files copied to the current heads of under test1 directory, if not automatically created in the script, the same way the current folder java copy the file to the directory of the current test2, a key automation.
Experiment Code:
# / bin / bash!
asd="/home/jim/fenlei/fenlei_c"
mkdir /home/jim/fenlei/fenlei_c
mkdir /home/jim/fenlei/fenlei_java
asd1="/home/jim/fenlei/fenlei_java"
for zh in *.c
do
cp ${zh} ${asd}
done
for z in *.java
do
cp ${z} ${asd1}
done
Results:
In the preparation of documents classified copy the file path to properly set up, we can enter the pwd command to view the native path.