10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have the following command which works partially:
gzcat *2016-03-25_*gz | gawk -F"|" '
BEGIN{format = "%-10s %-13s %-17s %-35s\n";
printf format, "EVENT_TYPE","RESPONSE_CODE","INTERNAL_ERR_CODE","FLOWNAME";
printf format, "----------", "-------------", "-----------------",... (6 Replies)
Discussion started by: EAGL€
6 Replies
2. UNIX for Dummies Questions & Answers
RHEL 5.4
Our Linux machine seemed to be running slow. So, I ran the top and vmstat commands.
Question1.
I can see the process 11517 consuming 100% CPU . But that just means that this process totally utilizes one of the cores in a mult-core CPU. Right ? This machine apparently has two... (2 Replies)
Discussion started by: kraljic
2 Replies
3. Shell Programming and Scripting
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)
Discussion started by: rveri
5 Replies
4. Shell Programming and Scripting
I have a strange issue.
(awk '$3 == "nfs" { cnt++ }; END { print cnt }' /etc/fstab)
This is giving different count each time.
To test this, tried the one here
-bash-3.2$ awk '/nfs/{print $2}' /etc/fstab | wc -l
151
-bash-3.2$ awk '/nfs/{print $2}' /etc/fstab | wc -l
145... (6 Replies)
Discussion started by: sureshmsi
6 Replies
5. Shell Programming and Scripting
Disclaimer: OP is 100% Awk beginner.
I use this code on ASCII files I need to report against.
awk 'BEGIN {
tokens = 0
tokens = 0
tokens = 0
}
{ for (token in tokens)
{ if ($1 == token){print $0; tokens++;}}}
END {for (token in tokens){
if( tokens ==... (1 Reply)
Discussion started by: alan
1 Replies
6. Shell Programming and Scripting
hi friends,
The code:
i=1
while
do
filename=`/usr/bin/ls -l| awk '{ print $9}'`
echo $filename>>summary.csv
#Gives the name of the file stored at column 9
count=`wc -l $filename | awk '{print $1}'`
echo $count>>summary.csv
#Gives just the count of lines of file "filename"
i=`expr... (1 Reply)
Discussion started by: rajsharma
1 Replies
7. Shell Programming and Scripting
x=`echo $line | awk -F "|" '{print $1;print NR}'`
How will I get the 2 return values ($1 and NR) from awk to variables? (4 Replies)
Discussion started by: tene
4 Replies
8. UNIX for Dummies Questions & Answers
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Discussion started by: JasonHamm
2 Replies
9. Shell Programming and Scripting
Hello,
I have a shell script that is used as follows:
./script -s <Oracle_server_name>
the script returns several lines in this format:
parameter name required value Current Value comments
--------------- ------------- -------------- ---------
My objective now is to compare 2... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
10. Shell Programming and Scripting
I have a output of a command like this.
the command is : bdf|sed '/^e/d'|awk '{print$2/1048576}'
output :
0
0.515625
0.481979
2
2
2
7.8125
4
2
0.488281
7.8125
3.90625
4
1.95312
1
0.488281 (4 Replies)
Discussion started by: Krrishv
4 Replies