This question already has an answer here:
#!/bin/bash # echo $PWD cd /home/<my username>/<long path> echo $PWD
What I get when executing it with
/home/<my username> : No such file or directorye/<my username>/<long path> /home/<my username>
bash . script.sh
.: .: is a directory
It looks like in first case it has just skipped first 4 characters (
/hom) of the address line for no reason.
And in second case, what the hell is
.: .:? It's absolutely "ungooglable".
And ofc when I copypaste this line
cd /home/<my username>/<long path> in terminal it works like it should.
EDIT: IT WAS ALL ABOUT ONE MISSING SPACE SYMBOL AT THE END OF THE PATH, THANK YOU.