converting from reliant 2 solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting converting from reliant 2 solaris
# 1  
Old 01-05-2009
converting from reliant 2 solaris

Hello...

I am trying to convert my script from one to another unix flavor...
from reliant to solaris...I did all but can not convert this awk/nawk:
First code if code that works what I want under reliant and the second should do same under solaris but it does not


I did so far from this :

Code:
awk  -vx=$deldate90 -vy=$deldate60 -vz=$unixdate ' 
        {ins = $4 $5 $6 
         expdate = $4 $5 $6 
                { if ( ins != "20010101" ) 
                     { if ( expdate < z ) 
                          {if ( expdate < x )
                              print $1","$2","$3"," $5"."$6"."$4",O"  > ("St"); 
                           if ( expdate >= x )
                              { if (expdate < y)
                                   print $1","$2","$3"," $5"."$6"."$4",D" > ("De")
                                if ( expdate >= y )  
                                   print $1","$2","$3"," $5"."$6"."$4",N" > ("In")}}
                       if ( expdate >= z && $4 != 2030) 
                           print $1","$2","$3"," $5"."$6"."$4",A" > ("Ak")}}} ' myfile


to this:

Code:
nawk -v x=$deldate90 -v w=$deldate60 -v z=$unixdate ' 
{

                expdate = $4 $5 $6
                
                if (expdate < z)
                {
                        
                        if (expdate < x)
                        {
                                print $1","$2","$3"," $5"."$6"."$4",O"  > ("/path/to/some/St")
                        }
                        else if (expdate >= x)
                        {
                                        if (expdate < w)
                                                {
                                                        print $1","$2","$3"," $5"."$6"."$4",D" > ("/path/to/some/De")
                                                }
                                        else
                                                {
                                                        print $1","$2","$3"," $5"."$6"."$4",N" > ("/path/to/some/In")
                                                }
                        }
                
                
                }
                                        
                else if (expdate >= z && $4 != 2030)
                {
                                                        print $1","$2","$3"," $5"."$6"."$4",A" > ("/path/to/some/Ak")
                }


}' myfile


but this new code does not do same thing like first one...
# 2  
Old 01-05-2009
any post...? Smilie

anyone?
# 3  
Old 01-06-2009
done it...code is OK error was in variable passing...Smilie

everyone be careful by passing values to awk


Smilie))
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help in converting

I have Excel file with the below three columns, i need your expertise in converting this to .csv file delimiter "|" Excel - Serial Number Serial Name Serial Brand 111 test sample 123 test2 sample1 134 ... (9 Replies)
Discussion started by: kiran_hp
9 Replies

2. Shell Programming and Scripting

Converting from Linux bash (GNU) to Solaris script syntax errors

Original script written on CentOS 6.3 with GNU bash 4.1.2 Destination system is Solaris 9 with GNU bash 2.05 (not changeable by me) I have a script written on the linux side but now we need to provide a version to another site that "doesn't like linux". I've been going through changing the ] or... (13 Replies)
Discussion started by: oly_r
13 Replies

3. UNIX for Dummies Questions & Answers

Converting HP-UX awk to Solaris

Hi, I am using awk in HP-UX to enter an encrypted entry of the password into /etc/passwd with success, this is the command I am using and it is working great. cat /tmp/passwd.gal.before|awk -F: -v gal_passwd="encrypted_password" '{OFS=":" ; print $1,gal_passwd,$3,$4,$5,$6,$7}' >... (3 Replies)
Discussion started by: galuzan
3 Replies

4. Solaris

converting midi to wav in solaris 10

how can i convert midi to wave in solaris 10 i have found timidity but it lack of documentation. is there any other suggestion? (1 Reply)
Discussion started by: conandor
1 Replies

5. Shell Programming and Scripting

FTP on Reliant UNIX - script problem

Hello... I have script that works perfect on solaris but on Reliant UNIX sometimes it does not work ...I send files to my Xp(from Reliant UNIX) but if I try to send it to my solaris machine file can not be send... script is: #!/bin/ksh localFile=$1 remoteFile=$2 ... (0 Replies)
Discussion started by: amon
0 Replies

6. SCO

Converting

I use Sco_Sv 3.2v5.0.5 with parellel conection using dump terminals and i want to convert them to desktop pc. Anybody knows what hardware and other thing that would be involved? (3 Replies)
Discussion started by: seeyou
3 Replies

7. UNIX for Advanced & Expert Users

Reliant Unix and Disk Mirrors

Hi Folks, This is already posted on Disk & Memory, will post under expert incase there is someone here who has seen this before. This one has me a bit confused. I have a large system running Reliant 5.45 with an EMC 3930 disk array fibre attached. As part of our requirement I... (0 Replies)
Discussion started by: gull04
0 Replies

8. Filesystems, Disks and Memory

Disk Mirrors in Reliant Unix - Problem?

Hi Folks, This one has me a bit confused. I have a large system running Reliant 5.45 with an EMC 3930 disk array fibre attached. As part of our requirement I implemented host level mirroring in addition to the BCV functionality provided by the 3930. When the mirrors are split and the... (0 Replies)
Discussion started by: gull04
0 Replies

9. Solaris

Problems with migration from Reliant Unix to Solaris

:confused: Hello folks, my company had decided to migrate from Reliant Unix to Solaris. We have an amount of sources that have to be changed a little, because these UNIX'es are slightly different. Is there a tool (hopefully free), which can do this job? Does anyone know the exactly differences, I... (2 Replies)
Discussion started by: MS-No
2 Replies

10. UNIX for Dummies Questions & Answers

problems with "cp" (reliant unix 5.43)

Hi, I've got a problem with the copy - command (reliant unix 5.43). It appears to me rather difficult to copy large amount of data. A command like "cp *.jpg" is simply refused. Does anybody know something about such a kind of restriction? Something like ... only 256 files could be copied at... (2 Replies)
Discussion started by: sysadv
2 Replies
Login or Register to Ask a Question