If you’re looking for a particular string, put quotes around it:
awk '$1 == "findtext" {print $3}'
Otherwise, awk will assume it’s a variable name.
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- How can I quickly sum all numbers in a file?
- How can I delete a newline if it is the last character in a file?
- GROUP BY/SUM from shell
- Finding contents of one file in another file
- Insert multiple lines into a file after specified pattern using shell script
- How can I trim white space from a variable in awk?
- Replace whitespace with a comma in a text file in Linux
- awk – how to delete first column with field separator
- How to declare 2D array in bash
- What does $@ mean in a shell script?
- Using awk to print all columns from the nth to the last
- Raise error in a Bash script
- How do I run a program with a different working directory from current, from Linux shell?
- How to run a shell script on a Unix console or Mac terminal?
- How to use sed to remove the last n lines of a file
- Use sudo without password INSIDE a script
- What is the difference between “source script.sh” and “./script.sh”?
- How to restrict SSH users to a predefined set of commands after login?
- What is the maximum size of a Linux environment variable value?
- How do I run multiple background commands in bash in a single line?
- Multithreading in Bash [duplicate]
- Difference between shell and environment variables
- SUID not working with shell script
- Recursive search and replace in text files on Mac and Linux
- Counter increment in Bash loop not working
- Syntax error near unexpected token ‘then’
- Check for IP validity
- Using awk to count the number of occurrences of a word in a column
- Why doesn’t “sort file1 > file1” work?