This question already has an answer here:
- Why doesn't “cd” work in a shell script? 3 answers
I want to executed command from file (which is script) in current shell in terminal.
Example: I have file
ch_dir contains following:
#!/bin/bash cd /usr
Now if I execute file usually as following then it executes commands in different shell:
pandya@pandya-desktop:~$ ./ch_dir pandya@pandya-desktop:~$
cd /user is executed in different shell.
But I want to execute in Current shell. How do I do that?
cd is only used to explain. Question's aim is to execute any command in current shell