10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have 2 files
recevied
abc
def
ghi
totallist
abc 123 jasdhfaj
def 345 fjdgkfsfh
ghi 567 dfjdhdhfj
jkl 678 djkahfdjshdf
xyz 984 jdfdhfhdh
myOutputFile
jkl 678 djkahfdjshdf
xyz 984 jdfdhfhdh
I used this command for the output : awk 'FNR==NR {f1;next} !($1 in f1)' recevied... (2 Replies)
Discussion started by: nani1984
2 Replies
2. Shell Programming and Scripting
found this handy one liner in another thread which is closed, it does what i need but im trying to understand it. it basically matches the field that contains the value v and prints its position
awk -F, '{for(i=1;i<=NF;i++)if($i==v)print i}' v=yourfield inputfile
my understanding is assign... (3 Replies)
Discussion started by: jack.bauer
3 Replies
3. Shell Programming and Scripting
Hi Guys,
Please help me, I am new to programming and I don’t understand what some parts of this code are doing. I have comments on the parts I know, please help if my understanding of the code is not correct and also help with parts with questions.
awk '
{
gsub( ">",... (1 Reply)
Discussion started by: James_Owen
1 Replies
4. Shell Programming and Scripting
#!/bin/ksh
log=ABCl
log=EFG
log=HIJ
i=0
while <------ what is the meaning of ($i - lt 3)
do
print ${log}
(( i=i+1 ))
done (1 Reply)
Discussion started by: Bperl1967
1 Replies
5. UNIX for Dummies Questions & Answers
awk '!_++'
Most importantly, I want to know what the underscore does "!_"
But ideally, please breakdown the whole thing. It is supposed to remove duplicate lines when found in a file. (1 Reply)
Discussion started by: glev2005
1 Replies
6. Shell Programming and Scripting
Hi frnds,
one my frnds has given resolution for my problem as below. it working great , but i couldnt understand somethings in the script.
Why ++ operator after the function calling. how these each block working. will each run for each input line sequencially or one block for all the lines... (9 Replies)
Discussion started by: Gopal_Engg
9 Replies
7. Shell Programming and Scripting
echo "23.54" | awk '
function round(A) {
return int( A + 0.5 )
}
{
printf("%d\n",round($1));
}'> > > > > >
awk: syntax error near line 2
awk: bailing out near line 2 (2 Replies)
Discussion started by: santosh1234
2 Replies
8. Shell Programming and Scripting
please explain this awk '{print \$NF}'
i have a command
grep -i adding /logs/eap | grep -iv equation | awk '{print \$NF}' | sort -u | sed 's/\.\$//' >> /temp/t
please explain the above awk and sed
as well how it works
and also what is \$NF (1 Reply)
Discussion started by: mail2sant
1 Replies
9. Shell Programming and Scripting
Hi,
I found this command in this forum, but, couldnt understand much from it.
could any one help me understand that???
the commands are :
awk '{sub(/ ~/,""); printf $0 ($0~/\|$/?ORS:"")}' file1 > file2
awk '{sub(/~ */,x);printf $0(/\|$/?ORS:x)}'
awk '{sub(/~ */,x);sub(/\|$/, "|\n")}8'... (4 Replies)
Discussion started by: hitmansilentass
4 Replies
10. Shell Programming and Scripting
I have a script which tries to read input from a user for every value read from a file. The input file is
#> more testfile
TEST1 | D200 | 12345601 | | ABC company | m
TEST2 | D201 | 12345602 | | ABC company | m
The script test.sh is as follows
while read line
do
read test?"Enter a... (5 Replies)
Discussion started by: jerardfjay
5 Replies