Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

ip address regex validate cmd

#!/bin/sh

ip=1.2.3.4

if expr "$ip" : '[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*$' >/dev/null; then
  echo "success"
else
  echo "fail"
fi
Comment

ip address regex validate cmd

#!/usr/bin/env bash

ip=1.2.3.4

if [[ $ip =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then
  echo "success"
else
  echo "fail"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: how to set min and max time for my password in ubuntu terminal 
Shell :: sshpass freezing 
Shell :: youtube dl text tracked playlist download 
Shell :: how to use uf 
Shell :: Calling Non-checksummed download of pup formula file from an arbitrary URL is disabled! 
Shell :: cant download tree ubuntu windows 10 
Shell :: #include <bluetooth/bluetooth.h 
Shell :: grep third line after match 
Shell :: uaing awk to print columns from multiple files 
Shell :: curl command to create a saved search for a user in splunk 
Shell :: wget --spidedr 
Shell :: windows git bash gradle bad characters 
Shell :: what should be used to create scratch orgs 
Shell :: install imamgemagic 
Shell :: fsl remove_ext 
Shell :: base16-shell 
Shell :: gubhit 
Shell :: camera from usb pi 3 
Shell :: install pusher srever in larvel 
Shell :: :flutter AndroidSdk/platform-tools/adb shell am start -n com.react2010/com.react2010.MainActivity 
Shell :: cheese not working in ubuntu 20.04 asus 
Shell :: Monitor your K8s cluster 
Shell :: install vnm on ubuntu 
Shell :: fsck fat32 partition 
Shell :: screen sharung zoom linux x11 
Shell :: zsh history by tab 
Shell :: container has runAsNonRoot and image has non-numeric user 
Shell :: how to know tachyons version 
Shell :: install glibc 2.14 redhat 6 
Shell :: separate a file by pattern 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =