I just want to write a script which changes my directory.
I put the below commands in the file /home/alex/pathABC
#!/bin/sh
cd /home/alex/Documents/A/B/C
echo HelloWorld
I did
chmod +x pathABC
In the Terminal, while in /home/alex
, I ran ./pathABC
, but the output is just HelloWorld
and the current directory is not changed.
So what is wrong?