Hi,
I made a small awk program just to test array variables.
I couldn't find anything wrong with it.
But it doesn't give out valid numbers.( just 0.00 )
Do you see any problem that I didn't see?
Thanks in advance!
Here is the program:
##################################
BEGIN {
FS =... (4 Replies)
I am running a program which probably calla script within, this script executes in a pop window and control returns back to main program.
Whilw this script is executing i can see a number of messages being displayed but I cannot read them ,too fast.
Is their a way I can redirect those... (3 Replies)
Hi,
I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program).
#!/usr/bin/sh
j=10
k=1
#k is declared outside awk
awk '
BEGIN {
i=1;
j1="'"$j"'"
printf("\n ## Value of j1 is %d ##", j1);
... (2 Replies)
I have a fixed width text file data.txt delimited by pipe. My requirement is to replace the second column values by *. Problem is that when tried access the shell variable in the awk program, value of shell variable is not printed instead only the name of the variable is printed. Please help to... (4 Replies)
Hi Experts,
I am trying to assing a value of current 'Mon DD' to the variable following way:
l_day=date '+%b %d'
Unfortunately, at the time of run, it says ' +%b %d: not found'
Thanks
Dip (2 Replies)
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
hi i want to find the size of a folder and assign it to a variable and then compare if it is greater than 1 gb.
i am doin this script, but it is throwing error....
#!/bin/ksh
cd . | du -s | size = awk '{print $1}'
if size >= 112000
then
echo size high
fi
ERROR : (4 Replies)
Hi Experts,
I am trying to get system output to capture inside awk , but not working:
Please advise if this is possible :
I am trying something like this but not working, the output is coming wrong:
echo "" | awk '{d=system ("date") ; print "Current date is:" , d }'
Thanks, (5 Replies)
Hi,
I have identified how to use command chaining as per below on a file, to capture the header of a file, as well as the line containing the C: drive.
$ cat test.txt
Filesystem Size Used Avail Use% Mounted on
rootfs 237G 153G 84G 65% /
none 237G 153G 84G ... (6 Replies)
Hi,
I am trying to use variable output in awk to append a string to a word in a line. But that is not happening. Could you please help me on this.
YouTube Video Tutorial: How to Use Code Tags and Format Posts @UNIX.com
The below is the code
#!/bin/ksh
set -x
src=/users/oracle/Temp... (2 Replies)
Discussion started by: pvmanikandan
2 Replies
LEARN ABOUT POSIX
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)