Hi! all here is my code
which is working fine no errors but I want to know how to take result and input to other program
if if statement is awk program in false
then
please help me
if not possible please give me solution in bash
Hi Akshay,
I think we're unable to help you because we're unable to figure out what you're trying to do.
We don't know what is in your input files.
We don't know what the values of the shell variables MAX, MIN, MN, and UID are.
We can assume that LC[1] is the number of lines in the 1st input file, but why is LC[2] set to the number of lines in both input files instead of the number of lines in the 2nd input file?
How are:
supposed to be processed? (That isn't valid shell command syntax. Is the j in these commands supposed to be related to the j in the 2nd for loop in the END clause in your awk script? Are XA[2,j,5] and Y[2,j,5] supposed to be related to the awk script's array element A[2,j,5] )?
Are you trying to pipe the output of the print statement in your awk script to one command and have the same output piped to a different command if the if statement doesn't print anything? Is it possible that you want something like:
as a replacement for the if statement in the END clause in your awk script?
This User Gave Thanks to Don Cragun For This Post:
Hi ,
Below is the script which prints result in json but when i validate it has some tab or extra space issues.
JSON result
{
"data":
}
This is the line I tweaked. Please advise.
print "\t{", "\"{#NAME}\":\""+container+hn+"\"}"
#!/usr/bin/env python
# (2 Replies)
So, this is weird... I'm running this command:
iotop -o -P -k -bt -d 5
I'd like to save the output relelvant to rsyslogd to a file, so I do this:
iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd
Nothing is written to the file! I can write the full output to the file:
... (2 Replies)
Hello,
And when you think you know the basics of something, UNIX in this case, something like what I will describe below comes along....
On a Linux system, a "typical" directory with some files. Say 20.
I do:
> ls | sort > mylisting
Now when I:
> vi mylisting
There is mylisting... (13 Replies)
I am trying to extract the file names alone, for example "TVLI_STATS_NRT_XLSTWS03_20120215_132629.csv", from below output
which was given by the grep.
sam:/data/log: grep "C10_Subscribe.000|subscribe|newfile|" PDEWG511_TVLI_JOB_STATS.ksh.201202*
Output:
... (6 Replies)
I have a program that returns a shell script and I want to execute the script.
I'll use cat in my simple example, but wget is an example that is feasible.
$ # First setup a script
$ echo "ls
> df" > simple
$ # "cat simple" is now a program that returns a script
$ cat simple
ls
df
$ ... (3 Replies)
I have five classes. 2 composition classes,1 aggregation class and 1 dependency class.I have coded all the classes but one of my test program is not giving me the expected result.I have the following classes:
TimeStamp
Interval (composition of 2 TimeStamps)
TimeSheet ( aggregation of many... (3 Replies)
Hi I'm just learning programming and need some help.
I've taken a data file which has a list of numbers eg:
3
5
32
533
13
2
And I've used sort -n and to sort and then piped it to awk to arrange into an array.
#!/bin/sh
sort -n data.txt |
awk '
{
array=$1
} (4 Replies)
Does anybody know any alternative way to save output result of a program into another new file?
I got try the command below:
program_used input_file > new_output_file
program_used input_file >> new_output_file
Unfortunately, both the ">" and ">>" is not work at this case to save the output... (6 Replies)
Alright, I'm sure there's a more efficient way to do this... I'm not an expert by any means. What I'm trying to do is search a file for lines that match the two input words (first name, last name) in order to remove that line. The removal part is what I'm struggling with. Here is my code:
echo... (4 Replies)
Hi, I am trying to write a program that will pipe any number of programs together like in the linux shell. As an example, the below code tries to execute "cat data | grep int | cut -b 1-10." The problem is that the programs never get executed for some reason. It seems like the first program... (3 Replies)