I have following 2 files:
file cd2vcaa (in path):
#! /bin/bash
cd /var/cache/apt/archives
file test.sh (in current directory):
#! /bin/bash
. cd2vcaa
From terminal, I am able to change directory with . cd2vcaa
but not with ./test.sh
~$ cd2vcaa <-- no effect
~$ . cd2vcaa <-- changes directory
/var/cache/apt/archives$ cd <-- back to home directory
~$ ./test.sh <-- does not change directory though no error - why?
~$
Why is . cd2vcaa
working from terminal but from within another script?
How can this problem be solved?