-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message error is missing #24
Comments
According to
So, validating can be performed as:
I agree a return code would be nice, but IIRC the long history of the netcalc code does not easily lend itself to adding that. |
Hi Lonnie,
Thanks for your attention.
I agree with you when you mention the global options: "no output if
invalid", the problem is that the validations are not working, cause in
booth cases that you used, the ip address are right, the first one, that
according to the answer, should be wrong, is only suppressed, not wrong.
About the output, is an easy problem to manage, unlike the validation.
Em qui., 23 de jun. de 2022 às 09:43, Lonnie Abelbeck <
***@***.***> escreveu:
… According to netcalc -h
Global options:
-c Validate the IPv4/IPv6 address, no output if invalid
So, validating can be performed as:
# test -n "$(netcalc -c 2fe1:d200:0:0:0:c801:a68::)"
# echo $?
1
# test -n "$(netcalc -c 2fe1:d200:0:0:0:c801:a68:0)"
# echo $?
0
I agree a return code would be nice, but IIRC the long history of the
netcalc code does not easily lend itself to adding that.
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZXTXYBKXJGG2JJ64JO3WOLVQRLW7ANCNFSM5ZT6MK3A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Well we could change it but anyone scripting with netcalc would possibly start experiencing regressions after upgrading. Making sure the |
Completely agree with You Mr. Wiberg. Thanks for your attention. |
@Diogofornazari any help or input on improving |
Tool doesn't return error if IP is invalid ( you can put any value, invalid values (zxvf:mlpr9:...) and the return is always 0, like if it was okay); if block 8 is suppressed it doesn't show ip address and it doesn't show any error (abff:0:ed4a:123f:ddd:3e4f:104f::);
Examples
#: netcalc zxvm:lçvd:: && echo Ok
#: Ok
#: netcalc 2fe1:d200:0:0:0:c801:a68:: 64
#: echo $?
#: 0
The text was updated successfully, but these errors were encountered: