This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# [Gedit Tool] | |
# Name=find | |
# Languages=go | |
# Input=nothing | |
# Output=output-panel | |
# Applicability=all | |
# Save-files=nothing | |
# Shortcut=<Primary><Shift>f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see working example:- https://play.golang.org/p/W5e7rMv6nXv | |
func WildcardRegExp(w string) string { | |
return "^" + strings.NewReplacer( | |
".", "\\.", // escape regexp special chars... | |
"^", "\\^", | |
"$", "\\$", | |
"+", "\\+", | |
"(", "\\(", | |
")", "\\)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example: test a group of files to see if together their hash is below a specified number; | |
cat * | sha512sum | tr " " "\n" | head -n 1 | [[ "`xargs echo $1`" < "00000001" ]] | |
(sha512sum always adds a file name on the same line, making this kind of stuff necessery) | |