This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

19.1 bash access violation


I'm trying to run bash from the nt command shell and am getting an access
violation.  The command is

c:\projects> bash -c "echo $(cat foo.txt)"

I also get an access violation on

c:\projects> bash -c "echo $(foo)"

where foo does not exist.

Both of these commands produce the expected output if issued from bash itself.  

The above commands do nothing useful but are simply reduced version of my real
command that does accomplish something.  What I really want to do is to
increment a counter in a file.  The way I have come up with to do this is

echo $(($(cat myfile)+1)) > myfile

This works from bash but not when I pass it in as a command string.  Is there an
easier way to do this? 

Ray
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]