shell 脚本获取当天路径然后返回上一级目录
#!/bin/bash
获取当前日期
current_date=$(date +%Y-%m-%d)
获取当前路径
current_path=$(pwd)
返回上一级目录
parent_path=$(dirname "$current_path")
echo "当前日期:$current_date" echo "当前路径:$current_path" echo "上一级目录:$parent_path"
原文地址: https://www.cveoy.top/t/topic/iYDn 著作权归作者所有。请勿转载和采集!