Sponsored Content
Top Forums Shell Programming and Scripting Help in Understanding awk if ( F ) syntax - Post 302901436 by rveri on Tuesday 13th of May 2014 06:38:18 PM
Old 05-13-2014
Help in Understanding awk if ( F ) syntax -

Hi Experts,

I was looking at the below link, for finding words next to it, And unable to understand this syntax:
Can any one please explain , what is meaning of this code:



Code:
if ( F )
s = s ? s OFS $i : $i

from:
HTML Code:
https://www.unix.com/unix-for-dummies-questions-and-answers/226523-match-pattern-after-certain-pattern-print-words-next-pattern.html
Thanks..

Last edited by vgersh99; 05-13-2014 at 07:45 PM.. Reason: fixed code tags for better understanding
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help on understanding the Shell and AWK scripts

Hello Friends, I am new to the scripting & have to analyze bunch of regular production scripts. It has .ksh which calls on the .awk script having many functions I need to understand and debug the scripts ASAP Can anybody please let me know as how can I debug, I want to see the flow of code... (3 Replies)
Discussion started by: amberj123
3 Replies

2. Shell Programming and Scripting

Help understanding syntax error Issue

Hi i as you may already know i am creating a menu driven program. I have chosen to take the approach of implementing each interface individually, after adding another interface and attempting to run the program i am faced with the following error: ./Assigntest: line 32: syntax error near... (6 Replies)
Discussion started by: warlock129
6 Replies

3. Shell Programming and Scripting

Understanding Awk and Cat

Hi Guys, I was recently come across some code to hopefully learn a little bit about putting Shell commands into PHP application to run on a Linux server. However, I don't understand the command AT ALL... and was wondering if anyone can interpret it: cat userIDs.dat | awk '{s=s+1; if... (1 Reply)
Discussion started by: jordRiot
1 Replies

4. UNIX for Dummies Questions & Answers

understanding part of an awk script

Hi I have an awk script running in ksh in which a section of code is picking out the datetime as follows: dia=`echo $starttime | nawk '{ printf "%02d\n", substr($1,9,2)}'` mes=`echo $starttime | nawk '{ printf "%02d\n", substr($1,6,2)}'` ano=`echo $starttime | nawk '{ printf "%02d\n",... (3 Replies)
Discussion started by: shajju
3 Replies

5. UNIX for Advanced & Expert Users

understanding awk in this script

i am analyzing a query written by another developer ,need to understand part of script am looking at a code ..and it converts comma files to pipe delimited and also takes away quotes from any columns, source field format: 2510,"Debbie",NewYork changes to target: 2510|Debbie|NewYork ... (1 Reply)
Discussion started by: coolrock
1 Replies

6. Shell Programming and Scripting

Help in understanding awk expression

Hi, Could somebody help me in understanding the following awk expression: awk -v n="POINT" '/%/{print $0 "\n" n ;next}1' < file name Thanks, Arun (6 Replies)
Discussion started by: arun_maffy
6 Replies

7. Shell Programming and Scripting

Syntax error, not understanding the issue?

Close please. Refer to following thread: Sub Menu issues (2 Replies)
Discussion started by: Banned
2 Replies

8. UNIX for Dummies Questions & Answers

Understanding awk

I found this on an awk site and would like to know what it does: /CARS/{x="";next} {if(x)print x;x=$0} END{if(x)print x}' Does it mean if it finds the word cars it skips that line and then prints the next one? (4 Replies)
Discussion started by: newbie2010
4 Replies

9. Shell Programming and Scripting

awk : Need Help in Understanding a command

Hello I am working on a Change request and Stuck at a point. The below awk command is used in the function. float_test ( ) { echo | awk 'END { exit ( !( '"$1"')); }' } I understand that awk 'END' is used to add one line at the end and exit is used to end the script with an error... (4 Replies)
Discussion started by: rahul2662
4 Replies

10. Shell Programming and Scripting

Understanding awk 'expansion'

Heyas Recently i wanted to help someone with an awk script, but the end-script didnt work as expected. He wanted, if HOME was empty, to get the HOME of the current USER from /etc/passwd. At first i tried hardcoded with root: awk -F: '/^root/ {print $6}' /etc/passwd As that worked, i've... (4 Replies)
Discussion started by: sea
4 Replies
FC-MATCH(1)															       FC-MATCH(1)

NAME
fc-match - match available fonts SYNOPSIS
fc-match [ -asvVh ] [ --all ] [ --sort ] [ --verbose ] [ [ -f format ] [ --format format ] ] [ --version ] [ --help ] [ pattern [ element... ] ] DESCRIPTION
fc-match matches pattern (empty pattern by default) using the normal fontconfig matching rules to find the best font available. If --sort is given, the sorted list of best matching fonts is displayed. The --all option works like --sort except that no pruning is done on the list of fonts. If any elements are specified, only those are printed. Otherwise short file name, family, and style are printed, unless verbose output is requested. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -a Displays sorted list of best matching fonts, but do not do any pruning on the list. -s Displays sorted list of best matching fonts. -v Print verbose output of the whole font pattern for each match, or elements if any is provided. -f Format output according to the format specifier format. -V Show version of the program and exit. -h Show summary of options. pattern Displays fonts matching pattern (uses empty pattern by default). element If set, the element property is displayed for matching fonts. SEE ALSO
fc-list(1) FcFontMatch(3) FcFontSort(3) FcPatternFormat(3) fc-cat(1) fc-cache(1) fc-pattern(1) fc-query(1) fc-scan(1) The fontconfig user's guide, in HTML format: /usr/share/doc/fontconfig/fontconfig-user.html. AUTHOR
This manual page was updated by Patrick Lam <plam@csail.mit.edu>. Aug 13, 2008 FC-MATCH(1)
All times are GMT -4. The time now is 07:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy