Hi, I would like to know what is the correct syntax to perform a function in awk. Although I have seen several examples, not get it to work, this is what I'm trying:
I have written many awk commands which go in multiple lines.
I have this confusion many times.
Some time they work if i dont terminate them with "\" but some time error.
Some time in "if" statements between if and else if i dont use ";" it gives error but sometimes it doesnt.
The below... (4 Replies)
I don't get correct output when I run this command line:
nmap -sP failedhost.com | grep -i failed | awk -F '{print $6}'
I basically want it to return 'failedhost.com' but its just showing the output of the nmap scan. (8 Replies)
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
i have a ksh code that needs to be written in AWK. can someone please help me here? :(
if }" | grep -c "$2") -gt 0 ] ; then
print - "found $2 in array ignore"
else
print - "did not find $2 in array ignore"
fi
ignore=4ty56r
ignore=er45ty
.
.
.
ignore=frhtg2 (27 Replies)
Hi,
I wanted to know what's the difference between the below two syntax used for writing ksh function:
e.g. 1
------
function fn1
{
echo "Hello World"
}
e.g. 2
------
fn1 ()
{
echo "Hello World"
} (4 Replies)
Hi !
I got a script from Arabic to Roman numeral conversion - .comp.lang.awk, that I would like to modify to apply it on my input file.
input ("|"-delimited fields):
AAAAAA|1, 10, 13, 14, 25, 60
wanted output:
AAAAAA|I, X, XIII, XIV, XXV, LX
script.awk:
#!/usr/bin/gawk -f
... (11 Replies)
Hi All,
I am getting a syntax error message while trying to compare 2 files using the compare function (LINUX)
command substitution: line 79: syntax error near unexpected token `('
command substitution: line 79: `cmp -s <(tr , \n < $COMMON_TMP/nt_per_gs.done | sort) <(tr , \n <... (5 Replies)
Needing a hint. Creating that function called Meter my simple script works well. What I want now is to start the last four commented lines to include or trigger a reaction, if there are more than n lines in that .txt-file it shall display that message for example. But the interpreter says there is... (3 Replies)
The below bash function uses multiple variables CODING, SAMPLE, SURVEY, andvariant
in it. The user selects the cap function and details are displayed on the screen using the $SURVEY variable, the directory is changed to $SAMPLE and the samples.txt is opened so the user can select the sample to... (6 Replies)
Hi,
I am having script which contains many functions. Need to print each function name at the starting of the function. Like below,
functionname()
{
echo "functionname"
commands....
}
I've tried like below,
func=`grep "()" scriptname | cut -d "(" -f1`
for i in $func
do
nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
LEARN ABOUT REDHAT
tzselect
TZSELECT(8) System Manager's Manual TZSELECT(8)NAME
tzselect - select a time zone
SYNOPSIS
tzselect
DESCRIPTION
The tzselect program asks the user for information about the current location, and outputs the resulting time zone description to standard
output. The output is suitable as a value for the TZ environment variable.
All interaction with the user is done via standard input and standard error.
ENVIRONMENT VARIABLES
AWK Name of a Posix-compliant awk program (default: awk).
TZDIR Name of the directory containing time zone data files (default: /usr/local/etc/zoneinfo).
FILES
TZDIR/iso3166.tab
Table of ISO 3166 2-letter country codes and country names.
TZDIR/zone.tab
Table of country codes, latitude and longitude, TZ values, and descriptive comments.
TZDIR/TZ
Time zone data file for time zone TZ.
EXIT STATUS
The exit status is zero if a time zone was successfully obtained from the user, nonzero otherwise.
SEE ALSO newctime(3), tzfile(5), zdump(8), zic(8)TZSELECT(8)