#!/bin/bash
MESSAGES=$(awk -F'from | port....' '/Invalid user/{printf $2 "\n" }' messages.htm)
echo -e $MESSAGES
Alright so the problem I have is I need that to output as a list(one IP address per line). However instead it throws all the IP address's it pulls out of a file into a space separated mess. If I run that awk command normally without assigning it to a variable it works perfectly fine and they each get their own line.
Anyways I need it to show one item per line, so that this will in theory work with it as well.
#!/bin/bash
MESSAGES=$(awk -F'from | port....' '/Invalid user/{printf $2 "\n" }' messages.htm)
DONE=$(echo -e $MESSAGES | sort -u )
So it will sort them and remove duplicates.
Any help would be greatly appreciated
MESSAGES=$(awk -F'from | port....' '/Invalid user/{printf $2 "\n" }' messages.htm)
echo -e $MESSAGES
Alright so the problem I have is I need that to output as a list(one IP address per line). However instead it throws all the IP address's it pulls out of a file into a space separated mess. If I run that awk command normally without assigning it to a variable it works perfectly fine and they each get their own line.
Anyways I need it to show one item per line, so that this will in theory work with it as well.
#!/bin/bash
MESSAGES=$(awk -F'from | port....' '/Invalid user/{printf $2 "\n" }' messages.htm)
DONE=$(echo -e $MESSAGES | sort -u )
So it will sort them and remove duplicates.
Any help would be greatly appreciated