Sponsored Content
Full Discussion: Usage of Int with NR in awk
Top Forums Shell Programming and Scripting Usage of Int with NR in awk Post 302912446 by RudiC on Friday 8th of August 2014 10:12:31 AM
Old 08-08-2014
Try yourself. Run:
Code:
awk 'BEGIN {for (i=1; i<=69; i++) print i, "filename" int((i-1)/34)".DAT"}'

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

difference between int ** func() and int *& func()

What is the difference between int** func() and int*& func(). Can you please explain it with suitable example. Thanks, Devesh. (1 Reply)
Discussion started by: devesh
1 Replies

2. UNIX for Dummies Questions & Answers

int open(const char *pathname, int flags, mode_t mode) doubt...

hello everybody! I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code: #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(){ int fileDescriptor; fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies

3. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

4. Shell Programming and Scripting

problem in awk int() function

awk -vwgt=$vWeight -vfac=$vFactor ' BEGIN { printf("wgt:" wgt "\n"); printf("factor:" fac "\n"); total = sprintf("%.0f", wgt * fac); total2 = sprintf("%.0f", int(wgt * fac)); printf("total:" total "\n"); printf("total2:" total2 "\n"); } ' if vWeight=326.4 vFactor=100 the result... (2 Replies)
Discussion started by: qa.bingo
2 Replies

5. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

6. Shell Programming and Scripting

Awk issue using int function

Hi, I am having issue with awk command . This command is running in the command prompt but inside a shell script. awk -F'| ' 'int($1)==$1 && int($3) ==$3' int_check.txt $cat int_check.txt 123|abc|123x 234|def|345 When i run it inside a shell script i am getting the error "bailing... (5 Replies)
Discussion started by: ashwin3086
5 Replies

7. Programming

Handle int listen(int sockfd, int backlog) in TCP

Hi, from the manual listen(2): listen for connections on socket - Linux man page It has a parameter called backlog and it limits the maximum length of queue of pending list. If I set backlog to 128, is it means no more than 128 packets can be handled by server? If I have three... (3 Replies)
Discussion started by: sehang
3 Replies

8. Shell Programming and Scripting

Advanced AWK Regexp substring to int & Replace

Hi! I have a difficult problem, to step up a unknown version number in a text file, and save the file. It would be great to run script.sh and the version gets increased. Example the content of the textfile.txt hello version = x bye This include three steps 1. First find the char after... (2 Replies)
Discussion started by: Beachboy72
2 Replies

9. Shell Programming and Scripting

Help with awk - Disk usage

Hi All, Would appreciate your help as to why the following code not showing the correct output. the issue is on the last else cause. I am trying to report on disk space based on percentage usage. for some reason, it's showing output as OK even thou disk space is 90% !!!! any ideas why? thanks!!... (2 Replies)
Discussion started by: xcod3r
2 Replies

10. Shell Programming and Scripting

awk usage

Hi I have a file like this user="joe" phone="4280919" duration=128 login=12/02/2016 ip-address=10.230.120.35 user="mary" phone="6352728" duration=23 login=16/02/2016 ip-address=10.123.231.54 I have to convert these to as follows (csv format) (Ignore Login field)... (6 Replies)
Discussion started by: Balav
6 Replies
Test::use::ok(3)					User Contributed Perl Documentation					  Test::use::ok(3)

NAME
Test::use::ok - Alternative to Test::More::use_ok SYNOPSIS
use ok 'Some::Module'; DESCRIPTION
According to the Test::More documentation, it is recommended to run "use_ok()" inside a "BEGIN" block, so functions are exported at compile-time and prototypes are properly honored. That is, instead of writing this: use_ok( 'Some::Module' ); use_ok( 'Other::Module' ); One should write this: BEGIN { use_ok( 'Some::Module' ); } BEGIN { use_ok( 'Other::Module' ); } However, people often either forget to add "BEGIN", or mistakenly group "use_ok" with other tests in a single "BEGIN" block, which can create subtle differences in execution order. With this module, simply change all "use_ok" in test scripts to "use ok", and they will be executed at "BEGIN" time. The explicit space after "use" makes it clear that this is a single compile-time action. SEE ALSO
Test::More CC0 1.0 Universal To the extent possible under law, XX has waived all copyright and related or neighboring rights to Test-use-ok. This work is published from Taiwan. <http://creativecommons.org/publicdomain/zero/1.0> POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 45: Non-ASCII character seen before =encoding in 'XX'. Assuming UTF-8 perl v5.18.2 2012-09-11 Test::use::ok(3)
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy