Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Grep for IP and DO when IP Found

 


No Format
#!/bin/bash

while [ -z "$IP" ];do

IP="$(ifconfig | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | grep -v 127.0.0.1 | grep -v 255)"

done

if [ -n "$IP" ]; then

echo "$IP"

fi

...

No Format
echo  $(date -u) >> log

Grep for Version Number:

No Format
egrep -o "([0-9]{1,}\.)+[0-9]{1,}" file