I use flex on cygwin package for Windows to build lexical analyzer.
I created file test.lex with rules
When i use this commands in command line
flex -i test.lex
cc lex.yy.c -lfl
./a
It works fine. But when i tried to make sh file (compile_flex.sh) with this commands and run file
./compile_flex.sh
I received error
flex: can't open test.lex
I tried to put different paths to my file
~/test.lex
/home/user/test.lex
c:\\cygwin64\\home\\user\\test.lex
But it doesn't work! I always receive message that file not found. When I put command
vi test.lex
In my .sh file it works good and file is opened in vim
I figured out with my problem. I use windows editor (notepad++) for create .sh file. When I changed line separator from \n\r to \n in preferences, it was working fine