tengo un problema, estoy intentando entender expresiones regulares en sed...
la verdad muy dificil!
el tema es que un script de SCA usa sed para insertar lineas en el squid.conf...
ninguna linea de lo que veran a continuacion se inserta con exito:
- Código: Selecionar todos
sed -i "/icp_ports 0/{p;s/.*/InserirYoutubeCacheAki/;}" $SQUID_CONFFILE
sed -i '/InserirYoutubeCacheAki/{p;s/.*/InserirYoutubeCachePrimeiraLinhaAki/;}' $SQUID_CONFFILE
sed -i '/InserirYoutubeCachePrimeiraLinhaAki/{p;s/.*/InserirYoutubeCacheSegundaLinhaAki/;}' $SQUID_CONFFILE
sed -i '/InserirYoutubeCacheSegundaLinhaAki/{p;s/.*/InserirYoutubeCacheTerceiraLinhaAki/;}' $SQUID_CONFFILE
sed -i -e 's@InserirYoutubeCacheAki@#Insercao SquidCacheAux@' $SQUID_CONFFILE
sed -i -e 's@InserirYoutubeCachePrimeiraLinhaAki@acl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id)@' $SQUID_CONFFILE
sed -i -e 's@InserirYoutubeCacheSegundaLinhaAki@acl QUERY2 urlpath_regex get_video\? videoplayback\? videodownload\?@' $SQUID_CONFFILE
sed -i -e 's@InserirYoutubeCacheTerceiraLinhaAki@cache allow QUERY2@' $SQUID_CONFFILE
sed -i '/(ace|adt|arj|asf|avi|bin|bz2|bzip|cab|dat|dll|doc|dot|exe|fla|flv|gz|iso|lha|log|lzh|mdb|mid|mov|mp3|mpeg|mpg|msi|mso|ogg|pps|ppt|rar|rm|rtf|shs|src|sys|swf|tgz|tif|ttf|wav|wma|wri|wmv|vpu|vpaa|vqf|vob|zip)$ 43200 100% 999999 ignore-reload/{p;s/.*/refresh_pattern (get_video\?|videoplayback\?|videodownload\?) 5259487 99999999% 5259487 override-expire ignore-reload/;}' $SQUID_CONFFILE
por ende lo que quisiera poder entender es la primera linea:
sed -i "/icp_ports 0/{p;s/.*/InserirYoutubeCacheAki/;}" $SQUID_CONFFILE
y luego esta:
sed -i -e 's@InserirYoutubeCacheAki@#Insercao SquidCacheAux@' $SQUID_CONFFILE
si alguien me puede aclarar que es "{p;s" ?
gracias...