I am presently writing a shell function and it would help me in writing it to be able to remove a . from the start of a folder name (changing the folder name from that of a hidden folder to that of a non-hidden folder). The folder name is stored in the variable $CWD, which itself is evaluated using:
CWD=${PWD##*/}
I would like to call the variable that equals $CWD without the . at its start $GWD. Presently I am trying to do this using sed, but I am open to any solution to this problem. This is what I have been trying:
GWD=$(sed -i 's/.*//' $CWD)
I have also tried substituting ' in this expression with " and I have tried substituting -i with -e. But this keeps returning the error:
sed: can't read .atom: No such file or directory
where CWD='.atom' for me at the moment.