Hi,
I've a question on awk. In English I want to:
(a) open a file, (b) search through the file for records where length of field15 > 20 characters and (c) print out some fields in the record.
I've written the following and it works OK. The trouble is this will ALWAYS write out the column... (5 Replies)
I'd like to define an alias to awk's begin statement since I use awk with different delimiters all the time and it is tiresome to type awk '{OFS="\t";FS="\t"}{BLAH BLAH}' every time. The problem is that bash won't let me make an alias with an open quote, which is necessary for the BEGIN alias to... (3 Replies)
I am beginner in awk
awk 'BEGIN{for(i=1;(getline<"opnoise")>0;i++) arr=$1}{print arr}'
In the above script, opnoise is a file, I am reading it into an array and then printing the value corresponding to index 20. Well this is not my real objective, but I have posted this example to describe... (1 Reply)
Here's the command I'm running:
# echo "hi" | awk '{etime = system("hostname") ; close("hostname") ; print etime""}'
And here's the ouput:
server.domain.tld
0
Why in the world is that second line, the one that's just "0", there? Many thanks in advance. (2 Replies)
I'm new to awk, trying to understand the basics.
I'm trying to reset the counter everytime the program gets a new file to check.
I figured in the BEGIN part it would work, but it doesn't.
#!/bin/awk -f
BEGIN {counter=0}
{
sum=0
for ( i=1; i<=NF;... (1 Reply)
Hi,
I have written below script to begin if the line has n
#!/bin/ksh
/usr/xpg4/bin/awk {/ n / 'BEGIN {X = "01"; X = "02"; X = "03"; X = "04";
X = "05"; X = "06"; X = "07"; X = "08";
X ="09"; X = "10"; X = "11"; X = "12"; };}
NR > 1 {print $1 "\t" $5 "," X "," $6 " " $7}'} input.txt |... (9 Replies)
Hello,
I need a little help with the following:
I'm using AWK to read input from a comma-seperated value file, and only printing certain fields like so:
awk -F "," '{print $1,$3,$6}' /list.csv | tail -1
Which outputs the following:
server1 APPID OS
I run into a problem... (8 Replies)
PCLOCK(1) General Commands Manual PCLOCK(1)NAME
pclock - pixmap clock
SYNOPSIS
pclock [options]
DESCRIPTION
This manual page documents briefly the pclock command. This manual page was written for the Debian GNU/Linux distribution because the
original program does not have a manual page.
pclock is a program that places a small analog clock program on the desktop of X. It was designed to run under the WindowMaker window man-
ager. It uses any 64x64 pixmap as a background.
OPTIONS
The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-') and short optoins starting with one
dash. A summary of options is included below.
-B PIXMAP, --background=PIXMAP
Use the given pixmap as the clock background (size must be 64x64).
-H COLOR, --hands-color=COLOR
Draw the hands (hour, minute and second) in the specified color.
-S COLOR, --second-hand-color
Draw the second hand in the specified color
-h, --help
Show summary of options.
--hour-hand-length=INT
Draw the hour hand with the specified length of INT.
--minute-hand-length=INT
Draw the minute hand with the specified length of INT.
--second-hand-length=INT
Draw the second hand with the specified length of INT.
--second-hand-width=INT
Draw the minute hand with the specified width of INT.
-s, --second-hand
Don't display the second hand.
-v, --version
Show version of program.
-w, --withdrawn
Don't start up in a withdrawn (iconic) state.
AUTHOR
This manual page was written by Darren Benham <gecko@debian.org>, for the Debian GNU/Linux system (but may be used by others). The soft-
ware is copyrighted (c) 1998 by and released under the GPL v2.
Author: Alexander Kourakos <Alexander@Kourakos.com>
Web: http://www.kourakos.com/~awk/pclock/
PCLOCK(1)