Sponsored Content
Top Forums Shell Programming and Scripting converting from reliant 2 solaris Post 302273580 by abdulaziz on Monday 5th of January 2009 08:37:17 AM
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...
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
RAKE(1) 						 Ruby Programmers Reference Guide						   RAKE(1)

NAME
rake -- Ruby Make SYNOPSIS
rake [--f Rakefile] [--version] [-CGNPgnqstv] [-D [PATTERN]] [-E CODE] [-I LIBDIR] [-R RAKELIBDIR] [-T [PATTERN]] [-e CODE] [-p CODE] [-r MODULE] [--rules] [variable=value] target ... DESCRIPTION
Rake is a simple ruby(1) build program with capabilities similar to the regular make(1) command. Rake has the following features: o Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?). o Users can specify tasks with prerequisites. o Rake supports rule patterns to synthesize implicit tasks. o Flexible FileLists that act like arrays but know about manipulating file names and paths. o A library of prepackaged tasks to make building rakefiles easier. OPTIONS
--version Display the program version. -C --classic-namespace Put Task and FileTask in the top level namespace -D [PATTERN] --describe [PATTERN] Describe the tasks (matching optional PATTERN), then exit. -E CODE --execute-continue CODE Execute some Ruby code, then continue with normal task processing. -G --no-system --nosystem Use standard project Rakefile search paths, ignore system wide rakefiles. -I LIBDIR --libdir LIBDIR Include LIBDIR in the search path for required modules. -N --no-search --nosearch Do not search parent directories for the Rakefile. -P --prereqs Display the tasks and dependencies, then exit. -R RAKELIBDIR --rakelib RAKELIBDIR --rakelibdir RAKELIBDIR Auto-import any .rake files in RAKELIBDIR. (default is rakelib ) -T [PATTERN] --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit. -e CODE --execute CODE Execute some Ruby code and exit. -f FILE --rakefile FILE Use FILE as the rakefile. -h --help Prints a summary of options. -g --system Using system wide (global) rakefiles (usually ~/.rake/*.rake ). -n --dry-run Do a dry run without executing actions. -p CODE --execute-print CODE Execute some Ruby code, print the result, then exit. -q --quiet Do not log messages to standard output. -r MODULE --require MODULE Require MODULE before executing rakefile. -s --silent Like --quiet, but also suppresses the 'in directory' announcement. -t --trace Turn on invoke/execute tracing, enable full backtrace. -v --verbose Log message to standard output (default). --rules Trace the rules resolution. SEE ALSO
ruby(1) make(1) http://rake.rubyforge.org/ REPORTING BUGS
Bugs, features requests and other issues can be logged at <http://onestepback.org/redmine/projects/show/rake>. You will need an account to before you can post issues. Register at <http://onestepback.org/redmine/account/register>. Or you can send an email to the author. AUTHOR
Rake is written by Jim Weirich <jim@weirichhouse.org> UNIX
November 7, 2012 UNIX
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy