Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

shell: how to grep a string

# You can do it in two ways
# 1) Let "grep" read on its standard input

echo "$line" | grep -o select

# 2) tell "grep" here is the string

grep select <<< "$line"
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #grep #string
ADD COMMENT
Topic
Name
1+7 =