neuralnode
Technical User
Hi All,
I want to replace a string with a wildcard and a regular expression on a Solaris 10 system. This is what I attempted:
awk '{sub(MaxAuthTries*[0-9]/, "MaxAuthTries 5");print}' /etc/ssh/sshd_config
but it failed with the following error:
awk: syntax error near line 1
awk: illegal statement near line 1
So my question is: how can I accomplish this feat?
As you can see, what I'm trying to do is to replace the string, e.g. "MaxAuthTries 8" with "MaxAuthTries 5". Because the number can be anything, I need to use regular expression that would tell to replace any numeric character.
Your advice is appreciated!
Thanx in advance.
I want to replace a string with a wildcard and a regular expression on a Solaris 10 system. This is what I attempted:
awk '{sub(MaxAuthTries*[0-9]/, "MaxAuthTries 5");print}' /etc/ssh/sshd_config
but it failed with the following error:
awk: syntax error near line 1
awk: illegal statement near line 1
So my question is: how can I accomplish this feat?
As you can see, what I'm trying to do is to replace the string, e.g. "MaxAuthTries 8" with "MaxAuthTries 5". Because the number can be anything, I need to use regular expression that would tell to replace any numeric character.
Your advice is appreciated!
Thanx in advance.