Until a few days ago both commands were working just fine from within a bash script. But suddenly cd gets completely ignored and skipped by the terminal and chown says the directory doesn't exist. But it does, cuz I created it myself + ls lists it as a directory. The weird part is that if I write the commands manually or even use an alias for chown, they work just fine. Only from within a bash script they won't. I even rewrote the script from scratch and they still wouldn't work. I checked all the filesystems, one was broken, so I reformatted the SSD and now gnome-disk-utility says this FS is OK. I also wrote a test script in my home dir containing just the cd command and it still won't work. I changed the command to change dir on one of the hard disks and it still won't work.
I also made a full system upgrade, hoping that the problem was simply old packages but the version doesn't seem to matter - full system upgrade or older kernel with older packages, these commands still won't work from within a bash script. And yes, I do know that the script must be executable! How else would I be able to use it for months without a single problem and suddenly it won't work?
I made a video, you can see for yourselves. I'm completely lost and have no idea WTH is going on here.
I also made a full system upgrade, hoping that the problem was simply old packages but the version doesn't seem to matter - full system upgrade or older kernel with older packages, these commands still won't work from within a bash script. And yes, I do know that the script must be executable! How else would I be able to use it for months without a single problem and suddenly it won't work?
I made a video, you can see for yourselves. I'm completely lost and have no idea WTH is going on here.