escaping double quotes in a file
Hi ,
I know it is pretty trivial but anyway...
I have php file that I am trying to read it looks like this
...
add_item_tabulky("Klaun-PF 2011","klaun_pf2011.jpg","","","");
add_item_tabulky("Prasátko-Šťastný celý_rok","prasatko_stastny_cely_rok.jpg","","","");
add_item_tabulky("Andílek na sáňkách","sanky.jpg","","","");
I dont*&^(^belong here
add_item_tabulky("Sněhulák","snehulak.jpg","","","");
add_item_tabulky("Stromeček-Veselé Vánoce","stromecek_vesele_vanoce.jpg","","","");
weird line
...
there are lines that begin with add_item_tabulky and also "weird lines" that dont begin with that...
now I need to echo both lines to a file but I need to transform the add_item_tabulky_line s first.
so I tried somehting like:
1 #!/bin/bash
2 while read line
3 do
4
5 if [[ "$line" =~ "add_item_tabulky(.*" ]]
6 then
7 echo $line
8 fi
9 done < $1
well bad news it has no output at all! Why is that? It is not the whole (rather complicated script but I just cant get this to work
What am i missin?
thnx
|