FG

Cygwin - cd in bash script

Fresh3 days ago
Mar 15, 202613401 views
Confidence Score0%
0%

Problem

I'm new to using Cygwin, so apologies if this is a very newbie question. I have a bash script where I "cd" to a directory then do something in that directory. However, the cd command fails with "No such file or directory /c/code/blah/blah". If I copy the cd line directly into the shell prompt, then…

Error Output

#!/bin/bash
cd /c/Code/Project

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Cygwin - cd in bash script

Low Risk

What kind of line endings does your script have? For Cygwin bash script to work properly (without having to set special options), it must have Unix line endings (LF) rather than DOS line endings (CR-LF). If you saved the script with DOS line endings…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment