expander.py スクリプト 自分用

.zshrc に関数を定義 expand-acl a.cpp みたいなのを書くと expanded-a.cpp ができる

expand-acl () {
    dir_cur=$(pwd)
    echo "${dir_cur}"
    dir_acl=path-to-ACL-directory
    echo "${dir_acl}"
    dup_file=${dir_acl}/dup-$1
    cp $1 ${dup_file}
    echo "file copied to ${dup_file}"
    cd ${dir_acl}
    python3 expander.py ${dup_file}
    new_file=${dir_cur}/expanded-$1
    mv combined.cpp ${new_file}
    rm ${dup_file}
    cd ${dir_cur}
}