Interesting question on sed
Hi All,
I have the following file.
$ cat test
#include "asd.h"
#include "awr.h"
#include "asfa.h"
case 1:
$ cat test | sed -e 's/i/I/g' -e 's/n/N/g/ >test
$cat test
#INclude "asd.h"
#INclude "awr.h"
#INclude "asfa.h"
case 2:
$ cat test | sed -e 's!\(#include\)[[:space:]]*\(.*\)!\1 \2!' -e 's!#include\ \"asd.h\"!#include\ \"ded.h\"!' >test
$ cat test
$
In case 2 the file "test" is blank.
Can anyone tell me why the file is balnked out in case-2 whereas it is not in case1?
I am using FreeBSD 6.3 and using BASH shell
Thanks,
14341