#!/bin/bash
command cd ../
When I enter the following at the cygwin bash command prompt, here are
the results:
------------------------------------------------------------------------------------------------
John@gateway-laptop ~/My C++/Sample - gcj & gcc
$ bash "./bs/Build C header file.sh"
: No such file or directory: line 2: cd: ../
John@gateway-laptop ~/My C++/Sample - gcj & gcc
$ "./bs/Build C header file.sh"
: No such file or directory: line 2: cd: ../
-----------------------------------------------------------------------------------------------
Surely, its something simple...
> $ bash "./bs/Build C header file.sh"
> : No such file or directory: line 2: cd: ../
>
I'm unsure why you put the word 'command' instead of just
cd ../
or cd ..
Please insert a line above that
pwd
to confirm what directory your /bin/bash is running the
script body from. Run the script again,
after it fails do some manual commands at the bash prompt
cd {to whatever that pwd command showed you}
command cd ../
and see if __that__ complains too.
Is it possible that an unintended alternate command called
command or command.exe is running, and does not understand
the ../ syntax? I tried doing cd / ; cd ../
and even that didn't cause an error message, so the
executable 'command' that you are running must be rather dumb.
Try
which command
to see which 'command' on your hard disk gets used. If it is
something down in windows then, oops!