I'm trying to get to grips with Bash scripting via Cygwin. My script is about as simple as it gets.
I change the directory to the root of my C drive, and print the new location.
#!/usr/bin/bash
cd /cygdrive/c
pwd
is saved in the file chdir.sh
in my home directory.
I then call ./chdir.sh
from the bash prompt. This results in the error
: No such file or directorygdrive/c
/cygdrive/c/Documents and Settings/rcotton
I definitely have a C drive, and the command cd /cygdrive/c
works when I call it directly from the bash prompt.
I realise that this problem is likely stupidly simple; please can you tell me what I'm doing wrong.