I found a bash script to validate ip addresses here: http://www.linuxjournal.com/content/validating-ip-address-bash-script
When i try to run it I get the error :
test.sh: line 22: syntax error: unexpected "(" (expecting "fi")
Line 22 looks like this:
ip=($ip)
Question
- Is this line supposed to be creating a list or array?
I've tried two different shells, and neither work. tried:
#!/bin/bash
and also
#!/bin/sh
Any suggestions would be appreciated.
valid_ip
function with an argument likevalid_ip 10.10.10.10
bash
only has arrays, not lists, the question doesn't really make sense.