Skip to content

Instantly share code, notes, and snippets.

@toshihirock
Created May 22, 2015 07:25
Show Gist options
  • Select an option

  • Save toshihirock/7c2378f35c8f3d6778c4 to your computer and use it in GitHub Desktop.

Select an option

Save toshihirock/7c2378f35c8f3d6778c4 to your computer and use it in GitHub Desktop.
#!/bin/bash
ip=192.168.0.1
if [[ $ip =~ ^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
echo "ip address"
else
echo "not ip"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment