Simple bash scripting

Posted by Richard Cotton on Super User See other posts from Super User or by Richard Cotton
Published on 2010-03-22T11:47:14Z Indexed on 2010/03/22 11:51 UTC
Read the original article Hit count: 641

Filed under:
|

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.

© Super User or respective owner

Related posts about bash

Related posts about cygwin