Can't use cd when writing bash script

Viewed 36

as you could see in the image I made a bash script in vscode but it isn't working as I expected. Everything is woring fine except the last line cd ~/union/union_2. It should enter my subdirectory union_2 but it isn't doing it. I also tried only typing cd union_2but I will then get an error message that there's no file or directory with that name. How do I use the change directory command in bash scripts?

Terminal and bash script

0 Answers
Related