snipplets.dev/~/Crystal/value_from_match.cr

9 lines
210 B
Crystal
Raw Normal View History

2022-04-08 17:34:07 +03:00
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