我想从脚本中获取全路径导演,即使用户输入“ ./”或“ /〜”
#!/bin/bash
echo "Enter the directory"
read DIRECTORY #how to store the full-path instead of something like ./
echo "$DIRECTORY"
使用realpath:
echo "$(realpath $DIRECTORY)"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句