编辑代码


#JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
filePath="dir01/basenameVal.log"
echo "$(dirname "$filePath")"  #输出$filePath变量值的directory部分,如果directory部分是多级目录就输出多级目录
echo "$(basename "$filePath")" #输出$filePath变量值的fileName部分

echo "
[current pwd]:" && pwd

echo "
[ls]:" && ls

cd ./csharp
echo "
After cd ./csharp [current pwd]:" && pwd

echo "
After cd ./csharp [ls]:" && ls

echo '
[ls | grep ".csproj"]:]' && ls | grep ".csproj"

touch include.log
echo "src/PerformanceDMS.Utility.WellTestingPerfAnalyzer.csproj" >> include.log
echo "test/PerformanceDMS.Utility.WellTestingPerfAnalyzer.Test.csproj" >> include.log
echo "
[cat include.log]:" && cat include.log

echo '
[while read]:'
        while read -r line 
        do
            # create project folder
            echo "$(dirname "$line")"
            mkdir -p "$(dirname "$line")"
            # move project file to the folder
            echo "$(basename "$line")"
            mv "$(basename "$line")" "$(dirname "$line")"
        done < include.log

echo "
After while_read [ls -l]:"
ls -l