Sed script not working properly on Solaris (works fine on AIX)?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sed script not working properly on Solaris (works fine on AIX)?
# 1  
Old 03-01-2012
Sed script not working properly on Solaris (works fine on AIX)?

Hi,

I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system.
The ksh script executes the SED and puts the output in HTML in tables.
But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is difference in Solaris why SED is not working correctly? The same SED script works fine on AIX.

Here is the SED script:

s/<br>//g
s/<b>//g
s/<\/b>//g
s/\ face\=\"Arial\" size\=\"2\"//g
s/^.*\..*\..*\..* \- \- \[\(.*\)\] \(.*\)$/<tr><td colspan=2><font color=black>\1<\/font> \2\<\/td><\/tr>/
s/\(\"CONNECT [0-9a-z\.\-]*\.test\.sipn\.test\.com\:443.* HTTP\/1\..\" 502 359.*\)\<\/td\>\<\/tr\>/<font color=green>\1<\/font>/
s/\(\"CONNECT [0-9a-z\.\-]*\.test\.sipn\.test\.com\:443.* HTTP\/1\..\" [45][0-9]* [0-9\-]*\)\(\<\/td\>\<\/tr\>\)/<font color=red>\1<\/font>\2/
s/\(\"CONNECT [0-9a-z\.\-]*\.test\.sipn\.test\.com\:443.* HTTP\/1\..\" [23][0-9]* [0-9\-]*\)\(\<\/td\>\<\/tr\>\)/<font color=green>\1<\/font>\2/
1 s/^/<tr><td colspan=2 align=center><font size=+1>TEST (proxy) log<\/font><\/td><\/tr>/

Thanks!
# 2  
Old 03-01-2012
Do you try using /usr/xpg4/bin/sed if its available?
# 3  
Old 03-01-2012
Thank you for your reply. But what do you mean exactly? Could you please explain it.
For the information i don't know much about SED.

The given location with SED is indeed available.
# 4  
Old 03-01-2012
This User Gave Thanks to itkamaraj For This Post:
# 5  
Old 03-01-2012
Quote:
Originally Posted by Faith111
Thank you for your reply. But what do you mean exactly? Could you please explain it.
For the information i don't know much about SED.

The given location with SED is indeed available.
Wherever you write sed, use /usr/xpg4/bin/sed instead.
Worth reading the additional link provided by itkamaraj.
This User Gave Thanks to clx For This Post:
# 6  
Old 03-01-2012
Quote:
Originally Posted by anchal_khare
Wherever you write sed, use /usr/xpg4/bin/sed instead.
Worth reading the additional link provided by itkamaraj.
I have now replaced /usr/bin/sed -f in the .ksh file, with /usr/xpg4/bin/sed -f.

But still no difference in the layout?

Here is a part of the .ksh script:

tail -10 ${APACHELOGDIR}/access_log /usr/xpg4/bin/sed -f ${SWDIR}/test_mon_b.dat >>${HTMLFILE}

I get the following error in command after running the script:

pargs: Couldn't determine locale of target process.
pargs: Some strings may not be displayed properly.
tail: cannot open input

Last edited by Faith111; 03-01-2012 at 04:55 AM..
# 7  
Old 03-01-2012
tail: cannot open input

is the variable has the value and are you tail'ing the correct file ?

${APACHELOGDIR}/access_log
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed not working properly with slash /

my testfile is aspsun1:usasp000$cat testfile open connection put $TMPDIR/SUNIA.PJ080202.ENGRPTBZ.<OPERATOR>.133 <FILENAME> quit my problem statement is to replace the line with put command with 2 different lines a cd command and then put line. from put... (2 Replies)
Discussion started by: gotamp
2 Replies

2. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

3. UNIX for Beginners Questions & Answers

sed command not working properly

This is my sample file cat bipin.txt Unix is an OS Unix has its own commmands Unix is a user friendly OS Unix is platform independent Unix is a time sharing OS the best OS to learn is Unix Abinitio uses Unix in backend When i use sed 's/Unix/Linux/' bipin.txt , only the first... (2 Replies)
Discussion started by: Bipin_1991
2 Replies

4. Shell Programming and Scripting

sed command not working inside ksh script but works fine outside

Hi, I am a bit confused ,why would a sed command work fine outside of ksh script but not inside. e.g I want to replace all the characters which end with a value and have space at end of it. so my command for it is : sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies

5. Shell Programming and Scripting

Getting Command not found error Even though Script is working fine

Hi friends, I am using below script to do some work. But even though script is working fine but while executing it i am getting command not found error. :( Here is the script :- #!/bin/sh Names="name.txt" ###main##### for LINE in `cat ${Names}` do ... (3 Replies)
Discussion started by: harpal singh
3 Replies

6. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

7. Shell Programming and Scripting

Not the correct output, works fine via CLI, not inside the script.

Guys, I need you help please. The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") " Syntax RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "` echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies

8. Shell Programming and Scripting

Script works fine but not with crontab

Hello All, This is driving me nuts. Wrote a very simple script (it's in csh so sorry about that). Just something very simple though. Here is the catch. Works great from command line sometimes. Other times it runs no errors or anything but I never receive an email. Never runs from crontab... (6 Replies)
Discussion started by: jacktay
6 Replies

9. Shell Programming and Scripting

NAWK Script not working fine

Hello to all can any one help me out with a nawk script. Actually i am having a shell script which uses nawk pattern searching and it is not parsing the file properly. I have been debugging it since long time, but nt able 2 find the root cause.. If any one can help me out with this one .. (3 Replies)
Discussion started by: dheeraj19584
3 Replies

10. Shell Programming and Scripting

Script works fine until I | more

Hello all, This beats me. I have a script that executes some commands and redirects their output to some text files that I will parse. The commands are along the lines of: dsmadmc -id=admin -pa=admin -outfile=/home/tools/qlog.txt q log f=d If I just run the script it works. If I execute... (2 Replies)
Discussion started by: Skovian
2 Replies
Login or Register to Ask a Question