ユーザーが「./」または「/~」を入力しても、スクリプトからフルパスディレクターを取得したいと思います。
#!/bin/bash
echo "Enter the directory"
read DIRECTORY #how to store the full-path instead of something like ./
echo "$DIRECTORY"
ベストアンサー1
使用実際のパス:
echo "$(realpath $DIRECTORY)"
ユーザーが「./」または「/~」を入力しても、スクリプトからフルパスディレクターを取得したいと思います。
#!/bin/bash
echo "Enter the directory"
read DIRECTORY #how to store the full-path instead of something like ./
echo "$DIRECTORY"
使用実際のパス:
echo "$(realpath $DIRECTORY)"