output.txt
1.1.1.1:22/ does not support password authentication. [ERROR] target ssh://2.2.2.2:22/ does not support password authentication. [ERROR] target ssh://3.3.3.3
i want to remove string :22/ does not support password authentication. [ERROR] target ssh:// from output.txt and to put IP addresses in new file
Desired output:
1.1.1.1
2.2.2.2
3.3.3.3
I tried with
cat output.txt | grep -vE "(:22/ does not support password authentication. [ERROR] target ssh://)
and
cat output.txt | egrep -v ":22/ does not support password authentication. [ERROR] target ssh://"
and cat output.txt | grep -v ":22/ does not support password authentication. [ERROR] target ssh://"
but above 3 commands do not remove nothing.
Tried with awk - same results:
awk '{gsub(":22/ does not support password authentication. [ERROR] target ssh://","");print}' output.txt
I didn't try sed because my string contains escape characters