I have hostname like following
www-foo-1001-1-1.example.com
I am writing script to which should deploy application which has following string match 1001-<any digit>-<any digit>
Example: script should match following hostname.
www-foo-1001-1-49
www-foo-1001-4-37
www-foo-1001-2-12
www-foo-1001-8-4
Ignore this pattern in hostname.
www-foo-1001-1-2-49
www-foo-1001-1-1-49
www-foo-1001-1
www-foo-1001
it has to match this pattern 1001-N-N and ignore anything else.
More details i want to do if then.. and return exit status code with $? to throw error who are not matching standard hostname.
hostnameas an argument and validate host before start installation.