bashubuntudash-shell

Redirector "<<<" in Ubuntu?


I'm getting this error

Syntax error: redirection unexpected

in the line:

 if grep -q "^127.0.0." <<< "$RESULT"

How I can run this in Ubuntu?


Solution

  • if grep -q "^127.0.0." <<< "$RESULT"
    then
        echo IF-THEN
    fi
    

    is a Bash-specific thing. If you are using a different bourne-compatable shell, try:

    if echo "$RESULT" | grep -q "^127.0.0."
    then
        echo IF-THEN
    fi