Hi friends,
I am trying to pass input from command line and trying to print that column values. (FYI: I am using ksh) My code goes like this...
#!/bin/sh
column=$1
awk '{print $'$column'}'
I execute using command like this --> ls -l | file_name parameter
Hope I am clear with my... (2 Replies)
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)
Hi,
Please could someone advise the issue i have with my awk command ?
my command is :
export NUM_SCENARIOS=`awk -F= '!/^#/ && /NUM_SCENARIOS/{print $2}' /home/environment.properties`
when I echo $NUM_SCENARIOS
this comes back with :
100 10
The issue I have is, there is... (9 Replies)
Hi guys,
i am trying to analyze a text file using awk and am not able to solve this issue.
This is the piece of code that I have written
BEGIN {
## Time to count MACs -> 5 seconds.
TIME_LIMIT = 5;
k = 50000;
}
## For every line.
{
time_in_seconds = $1... (2 Replies)
Hi all,
i am trying to use below command to see the output of hardware inventory, but i only see 2 first line no output of the command.
awk '/Hardware/ {print $0}' XXX_result.txt
Hardware inventory:
Hardware inventory:
any idea how to see whatever is under hardware inventory.
i... (11 Replies)
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
limit.csv data
--------------
5600050 38Nhava
400077 27Bomay
rate.txt data
-------------
38NhaVA
27BomaY
27Bomay
below is my script:
for i in `cat limit.csv`
do
b=`awk '{print $1}' $i` (4 Replies)
Hi All,
I have one file with below content
Post1:uri
Post2:urieop
Post3:urtei
I am trying to read each word seprated by delimiter with below command
Value1=$(awk -F":" '{print $1}' $HSFILE)
Value2=$(awk -F":" '{print $2}' $HSFILE)
echo $Value1
echo $Value2
It is... (5 Replies)
Hi,
Here is the output using bash profile on Linux
uptime
04:59:14 up 16 days, 4:48, 2 users, load average: 1.00, 1.00, 1.20
Here is the output using bash profile on Solaris
uptime
4:00am up 84 day(s), 22:21, 3 users, load average: 0.09, 0.10, 0.12
Now,... (4 Replies)
I am new to unix.I have a requirement to get few fields from the log file as below.
Log
app9/cc-gr_base.log.2017-07-19.gz: hostname 1500523166993 NA:NA:NA http-nio-8080-exec-56 INFO Points balance from MIS for user with userId: 19651069, first name: DEREK RICHARD and last name: BOUDREAU is... (3 Replies)
Discussion started by: nextStep
3 Replies
LEARN ABOUT CENTOS
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)