A partir deste comentário no estouro de pilha link
Eu cheguei à conclusão que o coreutils (que eu já tinha instalado) tem o comando greadlink
que tem a funcionalidade que eu preciso.
NEW_DIR=$(greadlink -f ../$1)
EDIT 1:
#!/bin/bash
if [[ $# -eq 0 ]] ; then
#simple check to ensure enter was not accidently pressed without directory specified
echo 'Whoa! You dont want to do that! you need to tell me where to put it';
exit 0
fi
ORG_DIR=$(pwd)
#here I want to get path before making directory, I've only figured out how to do after.
NEW_DIR=$(greadlink -f ../$1)
echo "Running scripts in"
echo $NEW_DIR
read -p "Are you sure? (y/n) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
cp -r $ORG_DIR/skeleton $NEW_DIR
cd $NEW_DIR
#init the project with default answers.
yarn init -y
#add dev scripts
yarn add --dev webpack webpack-cli babel-loader @babel/preset-react @babel/core @babel/preset-env webpack-dev-server css-loader sass-loader node-sass style-loader file-loader url-loader redux-devtools eslint eslint-plugin-react babel-eslint
#add production scripts
yarn add react react-dom react-hot-loader react-redux redux redux-saga redux-socket.io socket.io
fi