sort acl file based on filename

This commit is contained in:
2023-02-13 18:23:46 -05:00
parent 9b53611107
commit 743956cf15
2 changed files with 9 additions and 1 deletions

8
sort_acl.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/bash
# Sorts the output of getfacl records to stdout
# Assumes filenames don't contain + and |
awk '
BEGIN { RS="\n\n"; FS="\n"; ORS="\n"; OFS="|"}
// { $2=$2; print }
' | sort -k 1,1 -t '|' | tr '\n' '+' | sed 's/+/\n\n/g' | sed 's/|/\n/g'