snipplets.dev/snipplets/code/Crystal/value_from_match.cr
2023-08-05 22:45:06 +03:00

9 lines
210 B
Crystal

test_string_1 = "rw------- (0o600)"
# test_string_2 = "rwx------ (0o700)"
if /\d{3}/.match(test_string_1).try &.[0] != "600"
puts "Password file permissions is not RW for you.".colorize(:red)
exit(0)
end