what is wrong with this easy script

Posted by alex on Ask Ubuntu See other posts from Ask Ubuntu or by alex
Published on 2014-06-11T08:35:03Z Indexed on 2014/06/11 9:40 UTC
Read the original article Hit count: 481

Filed under:
|
|

what is wrong with this easy script? I just want to write an script which change my directory:

A. I put below commands on the file witch its name is pathABC on the /home/alex directory,

#!/bin/sh
cd /home/alex/Documents/A/B/C
echo HelloWorld

B. also I did chmod +x pathABC , On the terminal when I am on the /home/alex directory, I run ./pathABC .

But the output is just HelloWorld and the current directory remains with no change. I mean my directory remains as /home/alex and not go to the /home/alex/Documents/A/B/C.

So where is wrong?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about bash