![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| converting midi to wav in solaris 10 | conandor | SUN Solaris | 1 | 11-22-2008 07:52 AM |
| FTP on Reliant UNIX - script problem | amon | Shell Programming and Scripting | 0 | 06-26-2006 06:41 AM |
| Reliant Unix and Disk Mirrors | gull04 | UNIX for Advanced & Expert Users | 0 | 12-17-2004 04:56 AM |
| Disk Mirrors in Reliant Unix - Problem? | gull04 | Filesystems, Disks and Memory | 0 | 12-16-2004 07:07 AM |
| Problems with migration from Reliant Unix to Solaris | MS-No | SUN Solaris | 2 | 08-27-2004 07:21 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|