This is a question I posted on StackOverflow: fstream issue under 64-bits cygwin, glad to get help from Nemo on Stackflow, all credits goes to him. The problem is when I use 64-bits g++ to compile the same piece of code, I get unexpected different result. The source code looks like this: #include #include using
Think about this, you want to replace “XXX” with a path like “/path/to/YYY” in a file. Your file looks like this: XXX AAA XXX Your bash script looks like this: NEW_PATH="/path/to/YYY" VAR="XXX" sed -e '{s/$VAR/$NEW_PATH/g}' your_file Well, it won’t work, since single quotes ‘ will force bash to keep variables as-is. Ok, we try to