Sponsored Content
Full Discussion: Compatible awk command
Top Forums Shell Programming and Scripting Compatible awk command Post 302995749 by SkySmart on Tuesday 11th of April 2017 03:28:35 PM
Old 04-11-2017
Compatible awk command

the following command works beautifully. it basically grabs the content of a file from First to End, then excludes any lines containing specific patterns.

Code:
awk '/^First/,/^End$/ {if (!/#\/bin\/sh|not.*commonly|#/) print}'  datafile.

i never had any issues with the command until I ran it on a Ubuntu box 13.04. when i ran it against a datafile, I got back no response. Nothing was outputted to the screen. It wasnt until I installed gawk on the system that the command started to work.

can anyone help me rewrite this command to make it more portable with default versions of awk? i dont want to have to install gawk. this script will be run on a a client machine and they dont like having to install anything on their system because they fear it'll break something else.

Last edited by SkySmart; 04-11-2017 at 04:37 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Print Servers compatible with Solaris

Does anyone have any advice on what print servers to use with Solaris I used to use intel but they dicontinued the model we used. I would just use lpadmin to set them up . Any advice on this would be very helpful. (2 Replies)
Discussion started by: xmildx
2 Replies

2. Linux

VPN compatible with NAT

Hey, i was wondering if anybody knew of a good VPN that is compatible with nat? If a VPN will not work with NAT could it work with PAT? Right now i'm using RH9. I wanted to use IPsec but i don't think that is compatiable with nat or pat. Please correct me if i'm wrong. Thanks, Byblyk. (0 Replies)
Discussion started by: byblyk
0 Replies

3. Linux Benchmarks

Gd2 not compatible with Clientexec

Dear Frnds We are having WHM Cpanel in which many website are their , one of our customer want to install Clientexec software which requires GD2.0.28(compatible) library which is installed. The problem is libpng version which is incompatible with the GD library . Please kindly... (0 Replies)
Discussion started by: naik_mit
0 Replies

4. Solaris

Compatible NICs for Solaris 9 (9/05) x86

Hi, Please can someone recommend me a cheap PCI Network card for Solaris 9 (9/05) for an Intel based PC (x86). I currently have a US Robotics NIC installed, but Solaris does not recognise it and its been too much hassle to find drivers for it etc, so have decided to purchase another NIC that... (3 Replies)
Discussion started by: wajidc
3 Replies

5. UNIX for Dummies Questions & Answers

winzip compatible command

Dear friends, I m new to Unix, can anybody please guide me on how to zip and password protect a normal text (or any file) in unix prompt? (1 Reply)
Discussion started by: topgear1000cc
1 Replies

6. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

7. Hardware

is rhel 6 compatible with dell xps 14

is rhel 6 compatible with dell xps 14.I tried to install it but could not install.Installation hanged at detecting hardware (1 Reply)
Discussion started by: shamapraveen
1 Replies

8. Hardware

Trying to find a compatible OS for an old computer

Hello A friend and I recently got our hands on an old computer (a rainbow '83 I think), cleaned it, etc... And now we're trying to get the thing running. The problem is that the included OS is badly documented, so I thought of installing an old version of UNIX on it. So the questions are: Is that... (8 Replies)
Discussion started by: ijiboom
8 Replies

9. Shell Programming and Scripting

Looking for a perl-compatible regex solution

This is for PHP preg_match code - which is PCRE therefore looking for a perl compatible suggestion I have this line returned I want to match and return.. I want to match the two instances of string ending 'ABCXYZ' into an array. And on second element (ie. RootABCXYZ) only return the word... (4 Replies)
Discussion started by: deadyetagain
4 Replies

10. UNIX for Dummies Questions & Answers

Vim compatible

I have ubuntu 32 bit installed on VMware with win 7 as host operating system. I am a newbie to Linux shell mode and vi editor. When ever I open the vi editor and select insert mode I don't see the insert mode being highlighted at the bottom of the screen as it is supposed to be. Only when I enable... (4 Replies)
Discussion started by: sabsac
4 Replies
Xmark(1)						      General Commands Manual							  Xmark(1)

NAME
Xmark - summarize x11perf results SYNTAX
Xmark datafile DESCRIPTION
Xmark is a shell script that reads the indicated datafile and compiles a benchmark which it writes to standard output. It writes three numbers: A weighted performance number for the x11perf results. A weighted performance number for a standard SparcStation 1, with SunOS 4.1.2, X11R5 Xsun, and a CG3 dumb Color Frame Buffer. The Xmark, which is the ratio of the two numbers above. The datafile must be an ordinary file, produced by x11perf in the following way: x11perf -display display -v1.3 -rop GXcopy GXxor -all > datafile It is possible to run the GXcopy and GXxor tests separately, as long as they are concatenated to the same output file: x11perf -display display -v1.3 -rop GXcopy -all > datafile x11perf -display display -v1.3 -rop GXxor -all >> datafile or x11perf -display display -v1.3 -rop GXxor -all > datafile x11perf -display display -v1.3 -rop GXcopy -all >> datafile FILES
temp.$$ Temporary file created in the current directory, deleted after use. DIAGNOSTICS
Usage: Xmark datafile Xmark was invoked without arguments or with more than one argument, or with options. Xmark takes no options. Error: data file does not exist or is not ordinary. Xmark cannot find the datafile named on its command line, or the datafile is a special file such as a directory. WARNING: datafile contains nnn, not 441 or 447 'trep' results; The file named on the command line does not seem to be a file generated by x11perf in the expected way. Diagnostic: ERROR: sum of weights =nnn, not equal to 4566.0; There is an internal error in Xmark. SEE ALSO
X(7), x11perf(1), x11perfcomp(1) X Version 11 x11perf 1.5.4 Xmark(1)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy