![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed escape char | fed.linuxgossip | Shell Programming and Scripting | 2 | 10-04-2008 07:41 AM |
| How to replace any char with newline char. | mightysam | Shell Programming and Scripting | 5 | 09-18-2008 09:15 PM |
| char c = 882 | useless79 | High Level Programming | 1 | 07-30-2007 06:16 AM |
| char *p and char p[]. | arunviswanath | High Level Programming | 4 | 07-20-2006 03:11 AM |
| \n char in C | C|[anti-trust] | High Level Programming | 1 | 05-05-2005 07:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi all, I try to create a shell script to had the xiti tag at the end of servals web pages just before the <body/> tag. here is my script : Code:
#!/bin/bash
##################################################################
rm -R /home/hibern/TEMP/hibern
cp -R /home/hibern/TEMP/hibernorig /home/hibern/TEMP/hibern
value=0
cat << EOF > /tmp/xiti.tmp
<!--\
Xt_param = 's=279747&p=';\
try {Xt_r = top.document.referrer;}\
catch(e) {Xt_r = document.referrer; }\
Xt_h = new Date();\
Xt_i = '<img width="39" height="25" border="0" alt="" ';\
Xt_i += 'src="http://logv33.xiti.com/hit.xiti?'+Xt_param;\
Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();\
if(parseFloat(navigator.appVersion)>=4)\
{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}\
document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');\
//-->\
</script>\
<noscript>\
Mesure d'audience ROI statistique webanalytics par <img width="39" height="25" src="http://logv33.xiti.com/hit.xiti?s=279747&p=" alt="WebAnalytics" />\
</noscript></a>\
EOF
for file in `find /home/hibern/TEMP/hibern -name '*.html' -print`
do
export m_tag=`cat /tmp/xiti.tmp`
sed -e 's/<body>/'$m_tag'/g' "$file" > "$file".tmp && mv -f "$file".tmp "$file"
done
and here is my error :-( Code:
sed: -e expression #1, char 39: unterminated `s' command thanks in advance for your help |
|
||||
|
Thanks for your help, my issue is solved, here is the code :
Quote:
|
![]() |
| Bookmarks |
| Tags |
| sed xiti, shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|