answersLogoWhite

0


Best Answer

That is a difficult question to answer - the question is rather vague on what you intend to do. An awk script is a file containing awk commands that operate on 1 or more data files, based on selectors and actions resulting from that selector.

It all depends on what you want to do with the data. The program itself is just a text file that can be created by any editor and then interpreted with the awk command.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a awk script program in unix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why awk -f command is used?

The awk programming/scripting language is used to pattern match text and then do something with the result. Using the -f option indicates that the awk program/script has been stored in an external file instead of being specified inline with the command.


Why use awk -v command?

This is used when you want to give a variable in an awk script a value before the script starts executing, even before the BEGIN block. You would do this on the command line if the variable needs different values for different executions rather than hardcoding it in the awk script itself.


How do you read from file in unix shell script?

You will have to be more specific about what you intend to do. In general, a shell script by itself does not read file information and then do something with it. There may be calls to other scripting languages such as awk, perl, python, etc., that will actually read the information and process the data.


How do you write an awk script to delete duplicated line from a text file The order of the original lines must remain unchanged?

Hard to answer - you don't say where the duplicated line might be.


What is the difference between sed and awk?

They both are frequently used programs in UNIX, but they do different things. Read their manuals if you want to use them.


What are the roots of the AWK programming language?

The AWK programming language is a Unix based programming language, and is sometimes considered as a pseudo-C interpreter. It is mainly used for sifting through and organizing large amounts of data at one time.


What is awk in unix?

AWK is a programming language developed in 1977 by Alfred Aho, Peter Weinberger, and Brian Kernighan. It is was developed as a text-processing language - it has simple syntax to match lines of patterns, separate out the fields, and operate on them.


Write a shell script that prints a list of every unique word in a file in reverse alphabetical order?

cat FILE | awk 'gsub(/ /,"\n") gsub("\n","\n") {print}' | sort -ur


How do youdisplay the particular lines in unix with awk command?

In AWK, once you have a successful selector then the action could be to print the resulting line (if thats what you wish to do). For example, /a test/ { print ; } would match (and print) all lines containing "a test"


What is OERR utility?

The oerr utility (Oracle Error) is provided only with Oracle databases on UNIX platforms. oerr is not an executable, but instead, a shell script that retrieves messages from installed message files. The utility is not provided on Windows systems, since it uses awk commands to retrieve the requested text from the file.


How to write a Shell program to find the no of vowels in a text?

clear echo -n "Enter the Name / String:" while : do read name echo $name | awk '{print gsub(/[aeiou]/,"")}' done


What is an example shell script to print a certain range of lines of a file?

This can be done any number of ways in the Unix operating system. Using 'sed', you can use the address range to limit what you are printing, such as: sed -e '1,5p' < filename To just list lines 1 - 5 of a file, or the AWK or Perl scripting languages to do the same type of thing.