Sponsored Content
Full Discussion: HPUX to Linux awk conversion
Top Forums Shell Programming and Scripting HPUX to Linux awk conversion Post 302331587 by insania on Monday 6th of July 2009 03:42:58 PM
Old 07-06-2009
HPUX to Linux awk conversion

I have the following script to edit ^'s and newlines out of files to be entered into a database. This script has been around since the dawn of time (way before me).

Code:
#!/bin/bash

# Remove all ^ and \n from the source file, except do not remove ^^^\n
 cat myfile.hold  | awk '
 BEGIN {FS="|"; OFS="|"; OUTPUT=""}
 {
  gsub("\^$","",$0);
  gsub("\^\^$","^",$0);
  OUTPUT=OUTPUT $0;
  if (match(OUTPUT, "\^$"))
  {
   printf ("%s\n", OUTPUT);
   OUTPUT="";
  }
 } ' - > UNIQUENAME.out
 mv UNIQUENAME.out /testing/name.out

The probelm is when the script is moved from HPUX where it works great to Linux it gives the following error:

Code:
awk: cmd. line:4: warning: escape sequence `\^' treated as plain `^'

I dont know enough about awk and have attempted to research it and but i am having no luck.

Thanks,

Sean
 

9 More Discussions You Might Find Interesting

1. HP-UX

compiling linux driver to run on HPUX

Hi, a friend of mine gave me an old HP B180 Unix Workstation with HPUX, the only problem with that, the onboard graphicsbaord doesn´t work anymore. I want to buy a new PCI Graphicsboard (350RAMDAC), but they only have Linux drivers going with the card. Question: Is it possible to compile... (4 Replies)
Discussion started by: hilbi
4 Replies

2. Red Hat

Migrate HPUX print qeues to red hat linux

I was hoping somebody could help. I am looking to merge around 150 print queues on a hpux server to a red hat linux workstation. RHEL is using cups as a backend. Has anyone had success with this yet? Thanks in advance (0 Replies)
Discussion started by: dillzz
0 Replies

3. UNIX for Advanced & Expert Users

Migrate HPUX print qeues to red hat linux

I was hoping somebody could help. I am looking to merge around 150 print queues on a hpux server to a red hat linux workstation. RHEL is using cups as a backend. Has anyone had success with this yet? Thanks in advance (1 Reply)
Discussion started by: dillzz
1 Replies

4. Programming

Porting From Linux To Hpux

Gents, i'm a senior applications developer and need to port a Linux server application ( no additional / special libraries or unique header files ) to a HPUX enviroment. Any chance to compile it on the Linux using flags to create an HPUX binary with gcc? (8 Replies)
Discussion started by: anak0nda
8 Replies

5. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

6. Shell Programming and Scripting

Linux to ansi pc conversion

Hi All, I checked the old posts here. But could not find a solution for my question. I have a file created by one application in HP-UX. My client wants it to be converted into ANSI PC version. I have heard about unixtodos and have worked with it also. But I am totally unaware of of this ANSI... (0 Replies)
Discussion started by: Tuxidow
0 Replies

7. UNIX for Dummies Questions & Answers

Making a program compiled on Unix (HPUX) work on Linux

I am trying to make an application which works on unix to work on linux. I already tried copying the binary files and start it up but I am getting an error stating "Cannot execute binary file". Then I tried to recompile but i am getting an error whenever I tried to recompile. I am getting the... (1 Reply)
Discussion started by: khestoi
1 Replies

8. Ubuntu

Conversion of the format of a file in linux

How to convert a rtf file to a ttf file in ubuntu terminal? (2 Replies)
Discussion started by: poonam.gaigole
2 Replies

9. Solaris

New to Solaris IPMP (conversion from Linux)

Hi all, I been reading examples of how to setup IPMP and how it differs from Etherchannel. However, i am still unsure of how it really works and i hope gurus here can shed some light on the questions I have below while i will lab it up for my own test -> q1) for IPMP, there is no such thing... (23 Replies)
Discussion started by: javanoob
23 Replies
ExtUtils::Typemaps::OutputMap(3pm)			 Perl Programmers Reference Guide			ExtUtils::Typemaps::OutputMap(3pm)

NAME
ExtUtils::Typemaps::OutputMap - Entry in the OUTPUT section of a typemap SYNOPSIS
use ExtUtils::Typemaps; ... my $output = $typemap->get_output_map('T_NV'); my $code = $output->code(); $output->code("..."); DESCRIPTION
Refer to ExtUtils::Typemaps for details. METHODS
new Requires "xstype" and "code" parameters. code Returns or sets the OUTPUT mapping code for this entry. xstype Returns the name of the XS type of the OUTPUT map. cleaned_code Returns a cleaned-up copy of the code to which certain transformations have been applied to make it more ANSI compliant. targetable This is an obscure optimization that used to live in "ExtUtils::ParseXS" directly. In a nutshell, this will check whether the output code involves calling "set_iv", "set_uv", "set_nv", "set_pv" or "set_pvn" to set the special $arg placeholder to a new value AT THE END OF THE OUTPUT CODE. If that is the case, the code is eligible for using the "TARG"-related macros to optimize this. Thus the name of the method: "targetable". If the optimization can not be applied, this returns undef. If it can be applied, this method returns a hash reference containing the following information: type: Any of the characters i, u, n, p with_size: Bool indicating whether this is the sv_setpvn variant what: The code that actually evaluates to the output scalar what_size: If "with_size", this has the string length (as code, not constant) SEE ALSO
ExtUtils::Typemaps AUTHOR
Steffen Mueller "<smueller@cpan.org"> COPYRIGHT &; LICENSE Copyright 2009, 2010, 2011, 2012 Steffen Mueller This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 ExtUtils::Typemaps::OutputMap(3pm)
All times are GMT -4. The time now is 07:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy